Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

How to link temp table filled in one class to a dialog form and display the data

Posted on by 2,015

Hi Techies,

I am working on one requirement where we are processing some logic and filling temp table by selecting some records on form.Once we click a button- a class behind will process logic on selected records and fills a temp table with output. I have created a new dialog form which has this temp table as data source, and calling this form by using below code.

DialogRunbase dialogParameter = Dialog::newFormnameRunbase(formStr(customDialogForm),this);

        dialogParameter.caption("Parameter form");
        dialogParameter = this.dialogInternal(dialogParameter);
        return dialogParameter;

This shows me a dialog with fields obviously with blank data. Now my question is how can I refresh this dialog form with latest temp table buffer. Possibly I need to use linkPhysicalTableInstance() to get the latest buffer, I am searching more.

Can anyone help me on this please?

Any response is appreciated!

  • Reliable Profile Picture
    Reliable 2,015 on at
    RE: How to link temp table filled in one class to a dialog form and display the data

    Thanks Andre, Martin!

    As said linkPhysicalTableInstance() worked. Below is the code.

            DialogRunbase           dialog;
            dialog = element.args().caller();       
                 
            if (dialog && classIdGet(dialog.caller()) == classNum(callerClass))
            {
                callerClassObject = dialog.caller();         
                dataSource.linkPhysicalTableInstance(callerClassObject.parmFillTmp());
            }

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 228,588 Most Valuable Professional on at
    RE: How to link temp table filled in one class to a dialog form and display the data

    Yes, linkPhysicalTableInstance() is the right method *if* the type of the table is TempDB.

    If it's an InMemory table, you need setTmpData().

    Nevertheless I wonder whether temporary table is the right choice. How will you pack the data to store for batch processing, for instance?

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,554 Super User 2024 Season 2 on at
    RE: How to link temp table filled in one class to a dialog form and display the data

    Hi Sangram,

    You can create a button on the form which will create an instance of the class using x++ coding. Then you can also create a method on the class to pass the temporary table to a variable of the class.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans