RE: How can I customize post sales order to Posted sales Invoice?
Hi Ming,
There are multiple ways to customize this.
Scenario : 1
If you want to copy some field values from Sales Order to Posted Sales Invoice, you should create that field in both table with Same Field ID & datatype. If both field id & datatype are same, system automatically copy the values from Sales Order to Posted Sales Invoice. You don't need to do any code to copy the values.
Scenario : 2
if you want to copy field values which has different field id in both table, then you have to subscribe the below publisher to copy the values manually.
- To copy values from Sales Line to Sales Invoice Line, You have subscribe the below event in "Sales Invoice Line" table.
- To copy values from Sales Header to Sales Invoice Header, You have to subscribe any one of the below event in "Sales-Post" codeunit
- OnBeforeSalesInvHeaderInsert
- OnAfterSalesInvHeaderInsert
Scenario : 3
There are many events available in "Sales-Post" codeunit. you can subscribe the events to customize based on your requirement.