Cannot convert from System.Guid to byte[]

Forum Post: Change the Filter On option on Opportunity Associated View for Account form

Hi all,

In my plugin I create a new contact and then I try to associate it to a web role:

                            Entity contact = new Entity("contact");
                            contact["firstname"] = item["givenName"].ToString();
                            contact["lastname"] = item["surname"].ToString();
                            Guid newContact = service.Create(contact);

                            new Guid(newContact),  // I cannot pass newContact here
                            new Relationship("adx_webrole_contact"),
                            new EntityReferenceCollection() { new EntityReference("adx_webrole", role[0].Id) });

When a pass Guid from the newly created contact as a parameter inside Associate method, I get the error “Cannot convert from System.Guid to byte[]”

Any help would be much appreciated

Source link

Leave a reply

Please enter your comment!
Please enter your name here