Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Incident Customerid to Custom Task Customers object problem revisited

$
0
0

Hello All,

Back to this again as I used a workflow to handle this temporarily.

I have an if that checks if the customer field is populated.  It is also set as required on the form.

Since the customers data type on the custom task is a party list I used this code to create it from the incident customerid field.

                            Guid tmpCustomerObjectId = new Guid(localContext.TargetEntity.GetAttributeValue<Guid>("customerid").ToString());
                            Entity custParty1 = new Entity("activityparty");
                            custParty1["partyid"] = new EntityReference("account", tmpCustomerObjectId);
                            tmpCustomerObject = new EntityCollection();
                            tmpCustomerObject.Entities.Add(custParty1);                        

I then use this to copy it to the custom task. 
                        busiTask["customers"] = tmpCustomerObject;

Everything works if I remove this code the custom task is created properly.

I get this error.

Specified cast is not valid from plugin.

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images