ConstraintRelation.Constraints Property

 

Applies To: Dynamics CRM 2015

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; }
public:
[DataMemberAttribute]
property String^ Constraints {
    String^ get();
    void set(String^ value);
}
[<DataMemberAttribute>]
member Constraints : string with 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

© 2016 Microsoft. All rights reserved. Copyright