Here is an example of how to use QueryExpressionHelp to get a Contact's GUID.
QueryExpressionHelper queryHelper = new QueryExpressionHelper(EntityName.contact);
queryHelper.Columns.AddColumn("contactid");
queryHelper.Criteria.Conditions.AddCondition("FieldNameFromEntity", ConditionOperator.Equal, thisIsTheParameter);
queryHelper.Criteria.FilterOperator = LogicalOperator.And;
BusinessEntityCollection coll = service.RetrieveMultiple(queryHelper.Query);
contact user = (contact)coll.BusinessEntities[0];
Guid syscoGuid = user.contactid.Value.ToString();
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment