I am trying to use a QueryExpression to search for all users with a particular title to then populate into an email.
I know how to populate an activity party into an email, but I am having difficulty grabbing multiple users (maybe use a list?) and then getting them into the activity party.
Can you please help?
QueryExpression query = new QueryExpression { EntityName = "systemuser", ColumnSet = new ColumnSet("systemuserid") }; query.Criteria.AddCondition("title", ConditionOperator.Equal, "Developer"); EntityCollection Developerusers = service.RetrieveMultiple(query); foreach (Entity users in Developerusers.Entities) { //Code Here to grab all users //email.Attributes.Add("to", DeveloperParty); }
*This post is locked for comments