I have a plugin with a code snippet below on a custom entity. I am trying to add a quote detail on creation of this entity.
As soon as it executes it throws the exception "
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."
Guid productGuid = new Guid (result1[0].Attributes["productid"].ToString()); Guid UomID = new Guid(result1[0].Attributes["defaultuomid"].ToString()); Guid QuoteId = new Guid(dataSet[0].Attributes["quoteid"].ToString()); Entity quoteDetail = new Entity("quotedetail"); quoteDetail.Attributes["quotedetailid"] = _quoteDetailId; quoteDetail.Attributes["quoteid"] = new EntityReference("quote", QuoteId); quoteDetail.Attributes["productid"] = new EntityReference("product", productGuid); quoteDetail.Attributes["quantity"] = QuoteLines.Attributes["axsi_quantity"]; quoteDetail.Attributes["priceperunit"] = QuoteLines.Attributes["axsi_priceperunit"]; quoteDetail.Attributes["uomid"] = new EntityReference("uom", UomID); quoteDetail.Attributes["ispriceoverridden"] = true; service.Create(quoteDetail);
I suspect there is something wrong around the UOMID. Any pointers would be highly appreciated.