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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

getting data from two different tables through the args class

(0) ShareShare
ReportReport
Posted on by 45

Hi, 

I have a grid that displays data from two different tables, I'm using the args class to pass the data to another form  and it works for just one table but I can't get the other data table, I tired to use select statements but just keep getting me the same value gettingTwoTablesData.png

I have the same question (0)
  • Kareem Taima Profile Picture
    45 on at
    RE: getting data from two different tables through the args class

    thanks

    I'll try it

  • Kareem Taima Profile Picture
    45 on at
    RE: getting data from two different tables through the args class

    thank you a lot

    it's big help

  • Suggested answer
    Martin Dráb Profile Picture
    235,792 Most Valuable Professional on at
    RE: getting data from two different tables through the args class

    The best option may be using relatedTable() method. You can see an example in CustTable.name().

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: getting data from two different tables through the args class

    You can pass only one table buffer via args.record().

    But if you pass SalesAgreementLine, you always know how to fetch SalesAgreementTable, right?

    Or, if you pass SalesAgreementTable, you can iterate all lines in code.

    But, you can also user args.caller() to get the whole FormRun object of the caller form. Via FormRun you can access any object on the caller form. Including active records in all data sources.

  • Kareem Taima Profile Picture
    45 on at
    RE: getting data from two different tables through the args class

    Hi André ,

    I have a grid in FormA it has data from SalesAgreement table and AgreementLine table, when I select line and press buttonOpenFormB I need to have the data in the record from both table, but I only managed to get the data from SalesAgreement table using args class, I couldn't  get AgreementLine table data in FormB.. I managed to get the data using select statement between AgreementLine and SalesAgreement, I don't know if you can do it through args class or I'm just dreaming :D

    thank anyway

  • André Arnaud de Calavon Profile Picture
    297,200 Super User 2025 Season 2 on at
    RE: getting data from two different tables through the args class

    Hi Kareem,

    Can you provide more information? What exact tables are used on the first form and what should be the result when you start the second form?

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 665 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 595 Most Valuable Professional

#3
Yng Lih Profile Picture

Yng Lih 558

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans