Hi Guys,
If anyone can help me with this, really appreciatte, i write a plugin that create a Sales Order Detail for Order, but whn i created the amount not bring back automatically from Price list, buen when i added manually it does, my code:
var orderProduct = new Entity { LogicalName = "salesorderdetail" }; orderProduct.Attributes.Add("salesorderid", new EntityReference("salesorder", id_pedido)); orderProduct.Attributes.Add("productid", new EntityReference(producto.LogicalName, producto.Id)); orderProduct.Attributes.Add("quantity", Convert.ToDecimal(1)); orderProduct.Attributes.Add("uomid", new EntityReference("uom", producto.GetAttributeValue<EntityReference>("defaultuomid").Id)); service.Create(orderProduct);
And no calculate amount and totals, but the product is in the PreceList with amount.
Thanks.