I just created an email request using C# to send email from system user into employee (custom entity). In the custom entity i added an email field type. When i run the program it says,
invalid party object type 10024
here the code
QueryExpression qe = new QueryExpression("lnkt_employee"); //string[] cols2 = { "systemuserid", "domainname" }; qe.Criteria = new FilterExpression(); qe.Criteria.AddCondition("lnkt_codename", ConditionOperator.Equal, "ffatahillah"); qe.ColumnSet = new ColumnSet(true); EntityCollection colect2 = _service.RetrieveMultiple(qe); EntityCollection toUserParty = new EntityCollection(); toUserParty.EntityName = "lnkt_employee"; foreach (Entity ent2 in colect2.Entities) { string fullname = ent2.GetAttributeValue<String>("lnkt_codename"); Console.WriteLine("To : " + fullname); Entity toParty = new Entity("activityparty"); EntityReference userParty = new EntityReference("lnkt_employee", ent2.Id); toParty.Attributes.Add("partyid", userParty); toUserParty.Entities.Add(toParty); } if (toUserParty.Entities.Count > 0) { Email.Attributes.Add("to", toUserParty); }
Is it possible to fill the party with custom entity ?
*This post is locked for comments