In Sage X3, “Document type” is a mandatory field in every transaction screen. So we need to select document type while creating any transaction. Also, “Invoice” button is available in Sales Delivery screen to create Invoice entry of that Delivery from the delivery screen. And when Invoice is created by clicking on that Invoice button from delivery screen, default document type of Invoice will be selected automatically.
We recently had a requirement to link the Delivery Document Type to Invoice Document Type upon clicking the Invoice button in the Delivery screen. They were having no. of Delivery types and Invoice types saved in their respective document type masters. And they wanted to flow specific invoice type instead of default invoice type in invoice entry which will be created directly from the delivery screen. To do so we have created a Miscellaneous Table and linked the Delivery Document Type to the related Invoice Document Type.
New Stuff: Sage X3 Integration with Weighing Scales
As you can see, in the above screen shot we have mentioned all the Delivery Document Types in the Column “Code” and its corresponding Invoice Types in “Short description” Column of the Miscellaneous Table.
Now to link the invoice types, we have written a script to fetch the corresponding Invoice Type (Short description column) based on the Delivery Type Document (Code column) selected in the Delivery Screen and assigned the same Invoice Document Type which we have already saved in the Miscellaneous table for that specific Delivery type to the Invoice Type field in the Sales Invoice screen.
Below is an example of DFDI document type in the Delivery Screen.
After creating and validating Delivery entry with DFDI Delivery type, we will try to create Invoice of the same delivery by clicking on “Invoice” button.
As you can observe in the above screenshot, IFDI Invoice type is getting displayed which is saved against DFDI delivery type in the miscellaneous table. So it is mandatory to save invoice types against delivery types in the table to work this customization in a correct manner.
This way we have linked the Delivery document type to the Invoice document type in SageX3.