caso.Attributes["subjectid"] = 832a6ee3-35df-eb11-bacb-000d3abc0713; //GUID
When I go to insert I get this error
Invalid value type for attribute: subjectid of entity: incident, Expected Type: lookup, Actual Type: System.Guid
Thanks in advance
Hi,
Glad your problem was solved!
Regards,
Leah Ju
I have already solved it ... I post it in case it serves someonetry { Microsoft.Xrm.Sdk.Entity caso = new Microsoft.Xrm.Sdk.Entity("incident"); Microsoft.Xrm.Sdk.EntityReference contactId = new Microsoft.Xrm.Sdk.EntityReference("contact", queUsuario); Microsoft.Xrm.Sdk.EntityReference accountId = new Microsoft.Xrm.Sdk.EntityReference("account", queCuenta); Microsoft.Xrm.Sdk.EntityReference subjectId = new Microsoft.Xrm.Sdk.EntityReference("subject", tipologia); caso.Attributes["title"] = asunto; caso.Attributes["description"] = descripcion; caso.Attributes["prioritycode"] = new OptionSetValue(urgencia); caso.Attributes["subjectid"] = subjectId; caso.Attributes["customerid"] = accountId; caso.Attributes["primarycontactid"] = contactId; Guid incidentId = service.Create(caso); }
Muhammad Shahzad Sh...
51
Most Valuable Professional
Ramesh Kumar
42
David Shaw_UK
27