Applied to business classes‘ reference and collection properties. Specifies the criteria expression used to filter the List View displayed in a Lookup Property Editor or invoked by the LinkUnlinkController.LinkAction Action in a popup window.
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)] public sealed class DataSourceCriteriaAttribute : ModelExportedValueAttribute
<AttributeUsage(AttributeTargets.Property, Inherited:=True, AllowMultiple:=False)> Public NotInheritable Class DataSourceCriteriaAttribute Inherits ModelExportedValueAttribute
You can filter the data source for the List View displayed in a Lookup Property Editor or in the LinkUnlinkController.LinkAction Action’s popup window. For this purpose, apply the DataSourceCriteria attribute to the target property. Specify a criteria for filtering via the attribute’s dataSourceCriteria parameter. This value will be assigned to the IModelCommonMemberViewItem.DataSourceCriteria property of the Application Model‘s BOModel | <Class> | OwnMembers | <Member> node. Note, you can set or change this property’s value directly in the Application Model via the Model Editor.
- By default, the criteria which is assigned to a property via the DataSourceCriteria attribute in a base business class remains applied in the business class descendants.
An object which is added to a lookup via the New Action is always displayed, regardless of whether or not the DataSourceProperty or DataSourceCriteria attributes are applied.
When using the @This. prefix in DataSourceCriteria, note that the master object (for which the lookup editor is displayed) is referred to, even if the lookup displays a complex property. For instance, if the lookup property is Task.Project.Manager, then @This refers to Task and not to Project.
- DataSourceCriteriaPropertyAttribute overrides DataSourceCriteriaAttribute when both attributes are applied to the same property.
For details on this and other techniques of Lookup Property Editor data source filtering, refer to the How to: Implement Cascading Filtering for Lookup List Views.