Good Day Fellow Community,
(AX Dynamics 2012 CU13)
I have run across a need to add the functionality of splitting a sales order (due to backordered items). Our current process of this involves completely creating a new sales order that shares the same customer and patient information as the original order, providing way too much room for error. I have done some research to see what out-of-the-box AX provides regarding this circumstance, and found the "Copy Sales Order" button could be somewhat of a solution. Though this works, there is still much room for error, as when this process is used a new sales order must still be made under the right customer account and with a new PO, as well as split items must be removed from the old order.
Another solution that I have found and tested can be found here: http://axguruu.blogspot.com/2014/06/creating-new-sales-order-by-copying.html
Following the instructions found on the site, it successfully creates a new order with the items from the old order, but fails to pull over the patient name, patient address, and numerous other fields that are used frequently. What it does pull over is the header-level customer information such as name and address and uses that as the patient details. I have spent quite some time on customizing this author's process in attempt to fit our needs, but I am afraid I am not familiar enough with the numerous classes being called in the creation of a new sales order.
What I have managed to do is absolutely not best practice, but somewhat works while leaving a lot of holes for things to go wrong. I have it so when the user clicks the checkbox and enters the sales order number, the "Add New Address" form appears. In this form I have added a text box that references the sales order on the parent form, then another checkbox that populates all of the address fields with the original address info when checked, then closes the form. I have done this because I am unsure how to ensure that all of the address information writes to the necessary tables. Though this botchy solution may cover the address problem, it does not solve the bigger issue. I am looking to have every field in all of the fast tabs on the New Sales Order form to be populated with the exact data from the old sales order, as well as have the items and qty's carried over. Would anyone have a much simpler/best practice way to go about this?
Thank You!