Hi Kalpana,
You cannot set the cost price on the order line explicitly - it's automatically determined by your product's cost price (Product.CostPrice). That, however, you are free to change - that is, unless you're using our Stock Management add-on module, in which case product cost prices are maintained automatically (in connection with purchases being registered).
As a comment to your code, I believe you're setting the wrong sales price: You're setting the ('default') sales price of the product, rather than the unit net price on the order line. What you'd probably like to do is something like:
_orderLine.UnitNetPrice = Product.SalesPrice
or
_orderLine.UnitNetPrice = saleprice
- depending on whether you wish to explicitly set a specific sales price, or pick up the default sales price set up on the product master information.
Best regards,
You cannot set the cost price on the order line explicitly - it's automatically determined by your product's cost price (Product.CostPrice). That, however, you are free to change - that is, unless you're using our Stock Management add-on module, in which case product cost prices are maintained automatically (in connection with purchases being registered).
As a comment to your code, I believe you're setting the wrong sales price: You're setting the ('default') sales price of the product, rather than the unit net price on the order line. What you'd probably like to do is something like:
_orderLine.UnitNetPrice = Product.SalesPrice
or
_orderLine.UnitNetPrice = saleprice
- depending on whether you wish to explicitly set a specific sales price, or pick up the default sales price set up on the product master information.
Best regards,