This blog post is about exploring the new Microsoft feature that allows you to run X++ jobs on PROD and non-PROD environments without release and with 0 downtime.
In 10.0.25 you can run simple X++ scripts on a production environment without any downtime. This feature lets you run custom X++ scripts without having to go through Dynamics LCS or suspend your system. Therefore, you can correct minor data inconsistencies without causing any disruptive downtime.
To be able to use this feature you need to create a deployable package with ONLY ONE runnable class in it. To do this, you can create a new model and reference the models which object you will use in the X++ script. Then create the runnable class and generate a deployable package from Visual Studio only with your new model that has only one runnable X++ class.
After generating the deployable package you can go to System Administration – Periodic tasks – Database – Custom scripts.
Here you can upload your deployable package.
If your deployable package has not consisted of only one runnable job you won’t be able to upload it and a warning message will be displayed.
After successfully uploading the deployable package, another user (different from the one who uploaded it) must Approve the script in the process workflow.
After the approval, you should follow the workflow and Run a test.
If the test log is okay and is without any errors, you need to Accept the test log and then you will be able to Run the script.
After the execution of the script is completed, the log will be updated and you need to end the workflow by confirming that the purpose is resolved, the purpose is unresolved, or abandon.
This is a helpful feature by Microsoft if you need to do some small data corrections or delete dates from certain tables. This way you don’t have to raise a Microsoft ticket to do small data corrections on PROD DB or connect to the ACC or other T2 environments databases.
Also, runnable classes with dialogs can be imported here not just simple data correction scripts.
But please be careful with running scripts like this!
We hope that this blog post is helpful! If you are interested to join our team of Masters, check out our careers page, we have open positions for Microsoft Dynamics enthusiasts in every field.