---
title: Updating Dynamics AX Data Using X++ Scripts Guide | CFBS
description: True, your Dynamics AX developer has a role to play in the technical aspects of the ERP. For instance, you may be relying on him to create scripts...
image: https://blog.cfbs-us.com/hubfs/Businessman%20hand%20using%20mobile%20phone%20with%20digital%20layer%20effect%20as%20business%20strategy%20concept.jpeg
---

[![cfbs-full-logo-tm](https://blog.cfbs-us.com/hubfs/cfbs-full-logo-tm.svg)](https://cfbs-us.com/)

- [Services](https://cfbs-us.com/services/)
  
    - [Overview](https://cfbs-us.com/services/)
    - [ERP Upgrades](https://cfbs-us.com/services/erp-upgrades/)
    - [System Consolidation](https://cfbs-us.com/services/system-consolidation/)
    - [Methodology](https://cfbs-us.com/services/methodology/)
    - [Support & Training](https://cfbs-us.com/services/support-training/)
    - [Mobile/Web Development](https://cfbs-us.com/services/mobile-web-development/)
- [Software](https://cfbs-us.com/software/)
  
    - [Overview](https://cfbs-us.com/software/)
    - [ProMRO](https://cfbs-us.com/software/promro/) 
          - [STS Aviation Case Study](https://cfbs-us.com/software/promro/#case-study)
    - [Acumatica](https://cfbs-us.com/software/acumatica/) 
          - [Saddleback Leather Case Study](https://cfbs-us.com/software/acumatica/#case-study)
    - [Odoo](https://cfbs-us.com/software/odoo/)
    - [Dynamics 365 BC](https://cfbs-us.com/software/dynamics-365-bc/) 
          - [MemoParts Case Study](https://cfbs-us.com/software/dynamics-365-bc/#case-study)
    - [Dynamics 365 F&O](https://cfbs-us.com/software/dynamics-365-fo/)
    - [ISV Add-On Products](https://cfbs-us.com/software/isv-add-on-products/)
- [Industries](https://cfbs-us.com/industries/)
  
    - [Overview](https://cfbs-us.com/industries/)
    - [Job Shops](https://cfbs-us.com/industries/job-shops/)
    - [Manufacturing](https://cfbs-us.com/industries/manufacturing/) 
          - [Make-to-Order](https://cfbs-us.com/industries/make-to-order/)
    - [Maintenance, Repair & Overhaul](https://cfbs-us.com/industries/mro/) 
          - [Aviation](https://cfbs-us.com/industries/mro/aviation/)
          - [Heavy Equipment](https://cfbs-us.com/industries/mro/heavy-equipment/)
    - [Projects & Field Service](https://cfbs-us.com/industries/projects-field-service/)
    - [Construction](https://cfbs-us.com/industries/construction/)
- [About](https://cfbs-us.com/about-us/)
- [Resources](https://cfbs-us.com/resources/)
  
    - [Resource Library](https://cfbs-us.com/resources/)
    - [Blog](https://blog.cfbs-us.com/erp-decision-resources)
    - [Events](https://cfbs-us.com/events/)
- [Contact Us](https://cfbs-us.com/contact-us/)

![CFBS](https://blog.cfbs-us.com/hubfs/cfbs-logomark.svg)

- Services 
    - [Overview](https://cfbs-us.com/services/)
    - [ERP Upgrades](https://cfbs-us.com/services/erp-upgrades/)
    - [System Consolidation](https://cfbs-us.com/services/system-consolidation/)
    - [Methodology](https://cfbs-us.com/services/methodology/)
    - [Support & Training](https://cfbs-us.com/services/support-training/)
    - [Mobile/Web Development](https://cfbs-us.com/services/mobile-web-development/)
- Software 
    - [Overview](https://cfbs-us.com/software/)
    - [ProMRO](https://cfbs-us.com/software/promro/)
    - [Acumatica](https://cfbs-us.com/software/acumatica/)
    - [Odoo](https://cfbs-us.com/software/odoo/)
    - [Dynamics 365 BC](https://cfbs-us.com/software/dynamics-365-bc/)
    - [Dynamics 365 F&O](https://cfbs-us.com/software/dynamics-365-fo/)
    - [ISV Add-On Products](https://cfbs-us.com/software/isv-add-on-products/)
- Industries 
    - [Overview](https://cfbs-us.com/industries/)
    - [Job Shops](https://cfbs-us.com/industries/job-shops/)
    - [Manufacturing](https://cfbs-us.com/industries/manufacturing/)
    - [Maintenance, Repair & Overhaul](https://cfbs-us.com/industries/mro/)
    - [Projects & Field Service](https://cfbs-us.com/industries/projects-field-service/)
    - [Construction](https://cfbs-us.com/industries/construction/)
- [About](https://cfbs-us.com/about-us/)
- Resources 
    - [Resource Library](https://cfbs-us.com/resources/)
    - [Blog](https://blog.cfbs-us.com/erp-decision-resources)
    - [Events](https://cfbs-us.com/events/)
- [Let's Talk](https://cfbs-us.com/contact-us/)

 Follow Us

- <https://www.instagram.com/clientsfirstbusinesssolutions/>
- <https://www.facebook.com/ClientsFirstBusinessSolutions/>
- <https://www.linkedin.com/company/cf-bs/>
- <https://x.com/ClientsFirstTX>
- <https://www.youtube.com/channel/UCX4cfXQhpLMQuVNKdHYhb7Q>

# Tales From The Script:

04.13.26

![Dynamics AX](https://blog.cfbs-us.com/hubfs/Businessman%20hand%20using%20mobile%20phone%20with%20digital%20layer%20effect%20as%20business%20strategy%20concept.jpeg)

 

It is true your [Dynamics AX developer](https://clientsfirst-tx.com/about-us/staff-and-experience/?__hstc=4800236.5ef416d1ff18b4e3d2799893a2b676ad.1641953497195.1641953497195.1641953497195.1&__hssc=4800236.191.1641953497195&__hsfp=2406870324) has a role to play in the technical aspects of the ERP. For instance, you may be relying on him to create scripts for accomplishing various tasks.

However, if you are a [thorough AX user](https://clientsfirst-tx.com/resources/training-resources/?__hstc=4800236.5ef416d1ff18b4e3d2799893a2b676ad.1641953497195.1641953497195.1641953497195.1&__hssc=4800236.191.1641953497195&__hsfp=2406870324), it may be beneficial to have some basic knowledge on coding scripts. This is especially important if you regularly deal with large masses of data.  By large, we are referring to significant data, perhaps 5,000 or more records.

While you can always use Excel to sort out large data, the software’s performance significantly drops as the size of the data increases. For instance, if you have over 100,000 records to sort out, Excel is likely to “hang” and not produce the output you are anticipating.

To manage large masses of data, coding and running a script will make your work fast. This blog source was written by Murray Fife @murrayfife.

Here is an example on how you can easily code a script to manage large data, without having to call your developer.

## **Example on How to Code and Run X++ Script**

Let’s say that you want to update the **Calculation Group** of your recently shipped inventory, perhaps because you forgot to load it through DIEF. Here is how you can use[X++ script:](http://dynamicsaxtipoftheday.com/2014/09/06/quickly-update-data-through-x-scripts/)

 i) The first step is to create the script. To do this, click **CTRL+D** to open up the AOT.  
ii) Next, open the **Projects** explorer by clicking **CTRL+SHIFT+P.**  
iii) Right-mouse-click the **Projects** folder to reveal a **New** sub-menu. Click **Project** from the sub-menu to create a new project.  
iv) Name the new project you have created. For your benefit, give it a descriptive name.  
v) Next, open the newly-created project by right-mouse-clicking it and selecting **Open**. The project will be displayed.  
vi) Navigate to the header and right-mouse-click to reveal a menu. Select **New** on the revealed menu and choose the **Job**

vii) Now, create a variable that points to the table you want to update. In this example, our table is **InventTable** and the variable is **item.** Combining these two, we have the following code:

**InventTable item;**

viii) The next step is to create a loop that will step through every record. To do  this, type:

**while select** **forUpdate** item  
{  
}

 ix) Now add your code to find out if there is a record in the table to be updated.  The resulting code will look like this:

**if** (item)  
{  
}

 x) The final step is to add your code to update the record:

**ttsBegin**;  
**item.BOMCalcGroupId = "DEFAULT";**  
item.update();  
**ttscommit**;

 xi) At this point, your code will look like this:

static **void** Job11(Args \_args)  
{  
InventTable item;  
**while** **select** **forUpdate** item  
{  
**if** (item)  
{  
**ttsBegin**;  
**item.BOMCalcGroupId = "DEFAULT";**  
item.update();  
**ttscommit**;  
}  
}  
}

xii) The final step is to run the code. To start, click the green play button on the menu bar.  The script will run and update all  the records for you.

This is how you can easily update your [AX data](http://www.clientsfirst-ax.com/?__hstc=4800236.5ef416d1ff18b4e3d2799893a2b676ad.1641953497195.1641953497195.1641953497195.1&__hssc=4800236.191.1641953497195&__hsfp=2406870324) with X++ script.

[![What's New in Dynamics 365](https://hubspot-no-cache-na2-prod.s3.amazonaws.com/cta/default/20974759/27350510-9584-4cec-ba46-1e9c000ca4ad.png)](https://hubspot-cta-redirect-na2-prod.s3.amazonaws.com/cta/redirect/20974759/27350510-9584-4cec-ba46-1e9c000ca4ad)

- [![Share Article](https://blog.cfbs-us.com/hubfs/raw_assets/public/CFBS%20Theme%20-%202025/images/cfbs-share-icon.svg) Share Article](mailto:?subject=Tales%20From%20The%20Script%3A&body=Check%20out%20this%20article:%20https%3A%2F%2Fblog.cfbs-us.com%2Fmicrosoft-dynamics%2Fupdating-dynamics-ax-data-x-scripts)
- [![Back](https://blog.cfbs-us.com/hubfs/raw_assets/public/CFBS%20Theme%20-%202025/images/cfbs-back-icon.svg) Back to Articles](https://blog.cfbs-us.com/microsoft-dynamics)

## Related Articles

08.07.26

### [Bridge to Cloud 3 - Dynamics BC](https://blog.cfbs-us.com/microsoft-dynamics/bridge-to-cloud-3-dynamics-bc)

[Read Article](https://blog.cfbs-us.com/microsoft-dynamics/bridge-to-cloud-3-dynamics-bc)

## Ready to take the next step?

[Free Consultation](https://cfbs-us.com/contact-us/)

Our team brings unmatched efficiency and value for a smooth implementation and beyond. Find out how we can help your business gain a competitive advantage in the marketplace.

[Free Consultation](https://cfbs-us.com/contact-us/)

![cfbs-full-logo-tm](https://blog.cfbs-us.com/hubfs/cfbs-full-logo-tm.svg)

- <https://www.instagram.com/clientsfirstbusinesssolutions/>
- <https://www.facebook.com/ClientsFirstBusinessSolutions/>
- <https://www.linkedin.com/company/cf-bs/>
- <https://x.com/ClientsFirstTX>
- <https://www.youtube.com/channel/UCX4cfXQhpLMQuVNKdHYhb7Q>

- Services
  
    - [Overview](https://cfbs-us.com/services/)
    - [ERP Upgrades](https://cfbs-us.com/services/erp-upgrades/)
    - [System Consolidation](https://cfbs-us.com/services/system-consolidation/)
    - [Methodology](https://cfbs-us.com/services/methodology/)
    - [Support & Training](https://cfbs-us.com/services/support-training/)
    - [Mobile/Web Development](https://cfbs-us.com/services/mobile-web-development/)
- Software
  
    - [Overview](https://cfbs-us.com/software/)
    - [ProMRO](https://cfbs-us.com/software/promro/)
    - [Acumatica](https://cfbs-us.com/software/acumatica/)
    - [Dynamics 365 BC](https://cfbs-us.com/software/dynamics-365-bc/)
    - [Dynamics 365 F&O](https://cfbs-us.com/software/dynamics-365-fo/)
    - [ISV Add-On Products](https://cfbs-us.com/software/isv-add-on-products/)
- Industries
  
    - [Overview](https://cfbs-us.com/industries/)
    - [Job Shops](https://cfbs-us.com/industries/job-shops/)
    - [Manufacturing](https://cfbs-us.com/industries/manufacturing/)
    - [Maintenance, Repair & Overhaul](https://cfbs-us.com/industries/mro/)
    - [Projects & Field Service](https://cfbs-us.com/industries/projects-field-service/)
    - [Construction](https://cfbs-us.com/industries/construction/)
- Resources
  
    - [Resource Library](https://cfbs-us.com/resources/)
    - [Blog](https://blog.cfbs-us.com/acumatica-cloud-erp/)
    - [Events](https://cfbs-us.com/events/)
- Contact
  
    - [800.331.8382](tel:8003318382)
    - [info@cfbs-us.com](mailto:info@cfbs-us.com)

 © 2025 CFBS All Rights Reserved

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Chandler Hutchison",
    "url" : "https://blog.cfbs-us.com/microsoft-dynamics/author/chandler-hutchison"
  },
  "dateModified" : "2026-04-13T16:51:14.571Z",
  "datePublished" : "2014-10-02T05:00:00.000Z",
  "headline" : "Updating Dynamics AX Data Using X++ Scripts Guide | CFBS",
  "image" : [ "https://blog.cfbs-us.com/hubfs/Businessman%20hand%20using%20mobile%20phone%20with%20digital%20layer%20effect%20as%20business%20strategy%20concept.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.cfbs-us.com/microsoft-dynamics/updating-dynamics-ax-data-x-scripts",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.cfbs-us.com/hubfs/cfbs-full-logo-tm.svg"
    },
    "name" : "Clients First Business Solutions"
  }
}
```