QueryByAttribute substitute = new QueryByAttribute("productsubstitute") {
ColumnSet = new ColumnSet("substitutedproductid"),
};
substitute.AddAttributeValue("productid", opptyProd.GetAttributeValue<EntityReference>("productid"));
substitute.AddAttributeValue("direction", new OptionSetValue(0)); //uni-direction
substitute.AddAttributeValue("salesrelationshiptype", new OptionSetValue(3)); //substitute
ErrorCode: 0x80040203
Message: Condition for attribute 'productsubstitute.productid': expected argument(s) of type 'System.Guid' but received 'Microsoft.Xrm.Sdk.EntityReference'.
It says right in the picture, it's a lookup:
Are we supposed to hack and type randomly and course through error dumps like some web developer?
(apologies for the graphic quality. It's the fields of the Product Relationship entity in the default solution)
*This post is locked for comments