Using CrmReferenceTarget Attribute
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
Some property types require that you specify the entity type being referenced. The following type requires a CrmReferenceTargetAttribute attribute.
| Type |
| Lookup |
Example
The following example shows adding the input and output attributes to a Lookup property used in a custom workflow activity with the addition of the CrmReferenceTarget attribute.
public static DependencyProperty myLookupProperty = DependencyProperty.Register("myLookup", typeof(Lookup), typeof(NoOpActivity));
[CrmInput("My Lookup")]
[CrmReferenceTarget("account")]
[CrmOutput("My Lookup Output")]
public Lookup myLookup
{
get
{
return (Lookup)base.GetValue(myLookupProperty);
}
set
{
base.SetValue(myLookupProperty, value);
}
}
See Also
Concepts
.gif)