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)

Generate a list of mandatory fields

(0) ShareShare
ReportReport
Posted on by 52

Hi,

I wonder if it's possible to generate a list of mandatory fields in AX 2009? For example the mandatory fields when creating a customer.

Can you export this type of data from AX to Excel? It would help me a lot when doing migration since then I know what fields I must have.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Rikard Ekengren!

    To get the all mandatory fields from particular table you should use DictTable and DictField classes. For example:

    static void CheckMandatoryFieldsOnTable(Args _args)
    {
        DictTable dictTable;
        DictField dictField;
        int       i;
        TableId   tableId = tableNum(CustTable);
        ;
        
        dictTable = new DictTable(tableId);
        
        for (i=1 ; i <= dictTable.fieldCnt(); i++)
        {
            dictField = new DictField(tableId, dictTable.fieldCnt2Id(i));
            
            if (dictField.mandatory())
            {
                info(dictField.name());
            }
        }
    }


    But the tables not only the place where mandatory fields can be determine. You can set mandatory property to controls on a form.

  • Rikard Ekengren Profile Picture
    52 on at

    Hi Rustem,

    Thank you for quick response. Your suggestion sounds great but I'm not sure how to generate the list with this code.

    Do I do it while I'm inside the AOT inside AX?

    Regards

    Rikard

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Yes, inside AOT inside AX. But this is part of code what you're should write.

    You're should complete the code with export to Excel function with all tables list from AOT.

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
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans