have created a plugin in which i am creating Sales Order and then creating salesorderdetail (sales order products) dynamically. everything is working fine, products are shown correctly in the sub grid on order form but there is no price on the products at all.
i am using following code to create sales order product, when i create quote then quote product using same code (changing entity and references to quote) then later converting that quote to an order everything is fine all prices quantity but however when i creating order and order product directly not working. please suggestt.
var orderProduct = new Entity
{
LogicalName = "salesorderdetail"
};
orderProduct.Attributes.Add("salesorderid", new EntityReference("salesorder", OrderId));
orderProduct.Attributes.Add("productid", new EntityReference(product.LogicalName, product.Id));
orderProduct.Attributes.Add("quantity", Convert.ToDecimal(1));
orderProduct.Attributes.Add("uomid", new EntityReference("uom", uom.Id));
_service.Create(orderProduct);