web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Is it possible to compile, synchronize and save a particular table via x++ code

(0) ShareShare
ReportReport
Posted on by

Hi All,

After making changes to a table, be it records or table properties. is it possible to compile , synchronize and save the table via x++ code level.

If yes please let me know how could I do this?

Many thanks in advance.

Regards,

Mania

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,716 Super User 2026 Season 1 on at

    Hi Mania,

    It would be possible to do. There are some examples: The synchronization job itself and also on the setup checklist, there is an option to modify field length of certain types. Then it will also save properties.

    But what is the business scenario here? Note that this would require a user to have the system administrator role to be able to execute the coding which changes AOT objects.

  • Suggested answer
    Rudi Hansen Profile Picture
    4,079 on at

    This job should be able to do it.

    static void DevCreate_Table(Args _args)
    {
        #AOT
        TreeNode                treeNode;
    
        SqlDataDictionary       sqlDataDictionary = new SqlDataDictionary();
        Str                     tableName = 'CustTable';
        ;
        // Find the treenode for the table
        treeNode = TreeNode::findNode(#TablesPath);
        treeNode = TreeNode.AOTfindChild(TableName);
    
        // Do what ever change you need.
    
        // Compile Table
        treeNode.AOTcompile(1);
        
        // Syncronize Table
        appl.dbSynchronize(tableName2id(TableName));
        
        treeNode.AOTsave();
        treeNode.AOTrestore();
    }


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans