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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to create a dialog class

(0) ShareShare
ReportReport
Posted on by 607

Hi! can anyone pls tell me how to create a dialog class?

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,020 Super User 2025 Season 2 on at

    Hi AXBOY,

    Have a look at the documentation first: msdn.microsoft.com/.../aa877843.aspx

    If you have specific questions, please update your question then with more details.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi AXBOY,

    I provide sample code. Just test it and modify.

    //This is a dialog to display a dropdown list of all Customer records

    static void DialogScreen(Args _args)

    {

        Dialog          dialog;

       DialogGroup     dialogGroup;

       DialogField     dialogField;

       //Give a dialog name

       dialog = new Dialog("SAMPLE");

       //Specify a Label to the dialog field

       dialogGroup = dialog.addGroup("Customer");

       //Add the table field to use

       dialogField = dialog.addField(extendedTypeStr(CustAccount));

       //Run the dialog screen

       if (dialog.run())

       {

       //Display the record fields if available

       print dialogField.value();

           //Halt the execution to display the dialog screen

           pause;

       }

    }

    Regards,

    Sci

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi, AXBOY

    Use RunBase Framework (see)

    Here's the simple example as sample:

    Step 1:

    client server static ClassDescription description()
    {
    return "@SYS54106";
    }

    Step 2:

    void run()
    {
        // Local declarations.
        try
        {
            this.progressInit
            ttsBegin;
            // Reset the variables that were changed in the transaction.
            ...
            // Do the job.
            while select forUpdate myTrans...
            {
                progress.incCount();
                progress.setText

            ttsCommit;
        }
        catch (Exception::Deadlock)
        {
            retry;
        }
    }

    Step 3:

    private Query initQuery()
    {
        query query = super()
        queryBuildRange qbr;
        ;
        qbr = query.dataSourceTable(
            tableNum(InventTrans)).findRange(
                fieldNum(InventTrans,DatePhysical));
        if (!qbr)
        {
            qbr = query.dataSourceTable(
                tableNum(InventTrans)).addRange(
                    fieldNum(InventTrans,DatePhysical));
        }
        qbr.value(SySQuery::range(prevYr(PerDate),PerDate));
        qbr = query.dataSourceTable(
            tableNum(InventTrans)).findRange(
                fieldNum(InventTrans,DateFinancial));
        if (!qbr)
        {
            qbr = query.dataSourceTable(
                tableNum(InventTrans)).addRange(
                    fieldNum(InventTrans,dateFinancial));
        }
        qbr.value(SysQuery::value(perDate+1)
        + '..' + ',' + sysQuery::valueEmptyString());
        return query;
    }

    Run On

    Called

    ...Hope it helps to you!

     

    void run()
    {
        // Local declarations.
        try
        {
            this.progressInit
            ttsBegin;
            // Reset the variables that were changed in the transaction.
            ...
            // Do the job.
            while select forUpdate myTrans...
            {
                progress.incCount();
                progress.setText
                ...
                ...
            ttsCommit;
        }
        catch (Exception::Deadlock)
        {
            retry;
        }
    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans