Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

getting data from two different tables through the args class

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

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

    thanks

    I'll try it

  • Kareem Taima Profile Picture
    Kareem Taima 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
    Martin Dráb 230,214 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
    nmaenpaa 101,156 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
    Kareem Taima 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
    André Arnaud de Cal... 291,280 Super User 2024 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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans