Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

Send email request with custom entity

$
0
0

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 ?


Viewing all articles
Browse latest Browse all 143529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>