ConstraintRelation.Constraints Property
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
Gets or sets the set of additional constraints.
Namespace: Microsoft.Crm.Sdk.Messages
Assembly: Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)
Syntax
[DataMemberAttribute]
public string Constraints { get; set; }
<DataMemberAttribute>
Public Property Constraints As String
Property Value
Type: System.String
Type: String
The set of additional constraints.
Remarks
Constraints can specify resources to be included or excluded from the search criteria. Attributes that can be used in the expression for the constraint are:
calendarid
isdisabled
name
organizationid
resourceid
resourceskill
siteid
typecode
The expression also supports operations such as And, Or, In, Not, and so on.
Examples
The following example selects the resource only if the name is "John".
string constraint = @"
<Constraints>
<Constraint>
<Expression>
<Body>resource[""name""] == ""John""</Body>
<Parameters>
<Parameter name=""resource""></Parameter>
</Parameters>
</Expression>
</Constraint>
</Constraints>";
constraintRelation.Constraints = constraint;
See Also
ConstraintRelation Class
Microsoft.Crm.Sdk.Messages Namespace
Return to top
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright