Set Default Values in Change Status on Production Order in BC D365:
(1) In this blog we do some changes in the “Change Status on Prod. Order Page” as per the requirement. For this, you can set any value on the page, as per the below screenshot, By-Default values are given below.
(2) Now in this screen, we will set values as per the requirement via AL Code. For this:
- Create a “Change Status on Prod. Order” page extension.
- Call EventSubscriber → OnBeforeOnRun of codeunit “Prod. Order Status Management”.
(3) Create a “Change Status on Prod. Order” page extension, as shown.
(4) Call EventSubscriber, as shown. In this case, the “Update Unit Cost” value is true, when the page is call. For using the below code, you can set any value as per the requirement.
(5) After doing the above step, go to the Released Production Order list or Document, and press the button Change Status, as shown.