Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

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

(0) ShareShare
ReportReport
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 230,492 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... 291,419 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,419 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,492 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans