7/13/2023 0 Comments Staven apptrackerThis can either be another System Administrator, or a user with the "Approve custom scripts" duty. The script must be approved by another user before it can be run. Should you push a script to PROD, then it is just a class like any other class, and unless you also push something referencing that class (like a menu item), it will just be dead code. So you don't need to version it, push it to PROD, uninstall it, worry about differences in the script between PROD and UAT. The script is just data, and has a lifespan on the system that is typically measured in hours. This brings another significant benefit: In terms of ALM for the script, you can consider it "fire and forget". If a script is needed in multiple companies, it must be uploaded in each. Scripts are uploaded for the current company. This ensures it will not be approved and run by mistake. If a script is uploaded by mistake, it can be abandoned, rejected, or deleted. Execution of the script must be completed within this time window, otherwise the script must be uploaded again. The uploaded package is stored in the Azure temporary blob storage for 7 days. The class must have a public static void main(args) method.The deployable package must only contain one class - nothing else.The deployable package must not contain malware.These conditions are required for upload to succeed: Uploadingįirst you need to upload the deployable package. Notice it is a "one way street" - if something fails along the way, you need to start over by uploading again. Once a script is uploaded, it will go through these states. To become the preferred approach the tool must provide all the guard rails possible to reduce risks, keep audit logs to track any activity, and have a state model proving and guiding the process end to end. The tool is designed to be the preferred approach in the exceptional case where a data correction is needed which cannot be completed through a normal business flow. This tool is extraordinarily powerful, yet it can cause a lot of harm. Now a different workflow is available, one that doesn't require LCS or dealing with ALM concerns. It is already possible to author an X++ script, deploy it via LCS, and execute it via a menu item. In reality this feature doesn't enable anything new. The feature attracted a lot of attention and questions, so it is time to share more details, and go beyond what is covered in the official documentation. For a quick demo please see my previous post: I was hoping to find things like thread.BindNewAction but, that's apparently not right.The ability to run custom X++ scripts without any downtime is now available for all customers on version 10.0.25 and later. But, trying to implement that I hit a brick wall. Assign it a new operation as it completes the previous one, or queue them up to run in order and eventually feedback to the GUI thread that all jobs are complete. Have a single thread used in my "AppTrack" class. foreach (IOccurrences s in sel)ĬableChecking.CheckCables((IOccurrences)s, rtbLog, CableData, materials) It will fire a new worker thread for each one, and the nature of the interface with the external application means the processes interfere and give bad results/errors. This is causing me a big problem if there is a list of things to process, like the snippet below. Private static void SafeExecute(Action ActualThreadFunction, Action handler, List FormControls) () => AppTrack.SafeExecute(() => ActualThreadFunction(), exception, FormControls) public static void DoInSafeThread(Action ActualThreadFunction, List FormControls = null) In it are 2 functions (shown below) I use to fire the worker threads "safely", along with turning on/off certain form controls to prevent further user interaction. I have a class "AppTrack" that is being used to monitor all these applications for usage, reporting, and better exception handling. (disclaimer: this was my first dive into the world of threading and async processes, the feedback part works at least!) In each case I have a RichTextBox in the form, to provide feedback to the user during progressing - which needs to be async so that the textbox can update in real time. They talk to an external application that in some cases relies on simulating user interface (copy/paste functionality). I have several forms applications, that rely on worker threads to do all the processing.
0 Comments
Leave a Reply. |