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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How valid is that table contains an element.args()

(0) ShareShare
ReportReport
Posted on by 578

Hello, 

I pass record table (gcalctable in form A and salestable in form B) to form C. How valid is that table contains an element.args() in form C?

Form C

------------------------

gcalctable = element.args().record();
salestable = element.args().record();

if(gcalctable)

{

GCalcTable_Ds.query().......

}

else if(salestable)

{

SalesTable_Ds.query()........

}

Thank you in advance.

*This post is locked for comments

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

    Hi ismaelivan,

    You will possible get an error if you do it in this way. If the record is based on a salestable and you try to put it in the gcalctable, an error will be given.

    You can better first evaluate if there is a record and from what table. The command 'element.args().dataset()' will give you a table ID. Based on this ID, you can take action to fill the gcalctable or salestable.

    Then you can start with the if statement as you mentioned in your example.

  • André Arnaud de Calavon Profile Picture
    302,672 Super User 2026 Season 1 on at

    Code example:

    if (element.args().dataset())
    {
        switch (element.args().dataset())
            case tablenum(gcalctable):
                gcalctable = element.args().record();
                break;
            case tablenum(salestable):
                salestable = element.args().record();
                break;
    }


  • ismaelivan Profile Picture
    578 on at

    it's right, just what I needed!!

    if(element.args().Dataset() == tablenum(GPlanProdLine))

    {

    }

    Thank very much

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Volodya Profile Picture

Volodya 2

#2
tgudwanski Profile Picture

tgudwanski 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans