Hi all,
1)I am creating a sales order through code successfully, but unable to fill
the costprice for the respective sales Items. How to specify cost price
through code?
2) I am updating the sales order with status Invoice, Can i specify my own
invoice number and update a sales order. if so where and how to assign the
number as invoice number for a sales order.
Please help me out in resolving the above problems
Best regards,
dileep.
0
Comments
I am sorry to say, i dint understood your above reply .
I am using Dynamics Ax 2009. i need help regarding the above two queries.
Regards
Dileep
for the first query u can write this code and update the sales price with costprice.
SalesLine.SalesPrice = decround(InventSum::find(SalesLine.ItemId,SalesLine.InventDimId).costPricePcs(),2);
for the second query i need some clarification.
how u are updating invoice and which tables u are updating?
Thanks for your reply.
I need to create a sales order line through code and wanted to fill CostPrice field of Sales Line.
I have used the below line
SalesLine.CostPrice = InventSum::find(SalesLine.ItemId,SalesLine.InventDimId).costPricePcs();
and found there is some difference in Sales line cost price between manual creation and the Through code. I will try to explore this furthur
Regarding my second query..
I am using AxsalesTable to create a sales order and SalesFormLetter class to update the Order to the status invoice.
Invoice number is assigned by the system. I want to replace the Invocie number with my custom number through code.
Regards
Dileep.
Actually the invoice number is generated by sytem.
u can override the system generated number with u r customer reference number.
In SalesFormLetter_Invoice class in the (initJournal) method the system will assign the
generated sequence, there u can override the code and assign the number what ever u want.
I think it would help u.
Go through the class SalesFormLetter_Invoice (initJournal - method)