I understand that part, I just don't know how to extract the GUID id based on the productid. Here's my updated code. var ProductName="Nike Shoes"; QueryExpression qrySOD = new QueryExpression("sal esorderdetail"); string[] cols2 = { "salesorderdetailid", "productid" }; qrySOD.Criteria = new FilterExpression(); qrySOD.Criteria.AddCondition("productid", ConditionOperator.Equal, Guid.Parse(ProductName)); qrySOD.ColumnSet = new ColumnSet(cols2); var sod = _service.RetrieveMultiple(qrySOD); //Casting the reference to GUID Guid salesorderdetailid = (Guid)sod[0].Id; I'm getting the error where the ProductName should be in Guid format (xxxx-xxx etc.,) . Obviously, it's still a string...
↧