Running Custom X++ Scripts in Tier 2 or Higher Version Production Environment Without Downtime
x
Running custom X++ scripts in a Tier 2 or higher version production environment can be essential for tasks like updating inventory transactions. Here’s a step-by-step guide on how to do it without causing any downtime:
Example Scenario:
You need to update the inventory transactions for particular items in a Tier 2 or higher version environment.
Steps to Follow:
Prepare the Dev Box:
- Create a new model and add the necessary reference packages.
- Create a runnable class to update the specific inventory transactions.
Develop the Runnable Class:
[SysEntryPointAttribute]
public class UpdateInventoryTransactions extends RunBaseBatch
{
public static void main(Args _args)
{
UpdateInventoryTransactions updateInventoryTransactions = new UpdateInventoryTransactions();
updateInventoryTransactions.run();
}
public void run()
{
// Your logic to update inventory transactions
// Example: Update inventory transactions for a particular item
InventTrans inventTrans;
select forUpdate inventTrans where inventTrans.ItemId == 'YourItemId';
ttsBegin;
// Perform your updates here
inventTrans.StatusIssue = InventTransStatus::Sold;
inventTrans.update();
ttsCommit;
}
}
Create a Deployable Package:
- Build and create a deployable package for the runnable class.
Upload the Deployable Package:
- Navigate to your Tier 2 or higher version environment.
- Go to the System Administration module.
- Path:
System Administration
→Periodic Tasks
→Database
→Custom Scripts
.
Upload the Package:
- Click on the Upload button and upload the deployable package you created.
- Click on the Upload button and upload the deployable package you created.
Approval Process:
- Once the package is uploaded, it needs to be approved. Ensure someone with the necessary permissions approves the deployable package.
- Once the package is uploaded, it needs to be approved. Ensure someone with the necessary permissions approves the deployable package.
Testing the Script:
- After approval, test the process in a controlled manner to ensure it performs as expected.
Run the Script:
- If the test results are as expected, click RUN to execute the script.
- The script will update the inventory transactions for the specified items without causing any downtime.
By following these steps, you can effectively run custom X++ scripts in a production environment, ensuring critical updates and changes are made seamlessly and without disrupting ongoing operations.
About Our Team
Our team is composed of software development and analysis experts who have worked both domestically and internationally:
- Nghia Song (Mr.) - Technical Architect. With over 6 years of experience in implementing ERP and integration projects.
- Jone Nguyen (Mr.) - Senior Technical Consultant. With practical experience in 25 E-invoice projects with software systems of businesses both domestically and internationally.
- Victor (Mr.) - Senior Project Manager.With over 12 years of specialized experience in Dynamics 365 Fno.
- Lisa Doan (Ms.) – Finance Consultant. A consultant specializing in accounting on Dynamics 365 FO and consolidated accounting systems.
No comments:
Post a Comment