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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Pass Selected Grid Records Between 3 Forms to Edit

(0) ShareShare
ReportReport
Posted on by 1,214

Hi, I have Form A , B & C.

In Form A, there's a grid and an edit menuitembutton for editing the selected grid record.

Form A and it's grid datasource is Table A. 

When the edit menuitembutton is clicked, the selected grid records needs to be passed to Form B.

In Form B, there's two date fields for user inputs and another menuitembutton for opening Form C.

Form B datasource is Table A.

When the menuitembutton in Form B is clicked, I want to pass together the selected grid record received from Form A and the date inputs to Form C.

Form C datasources are Table A & Table B. 

In Form C, there's two sections. In section 1, I want to edit the selected grid records (datasource Table A).

In section 2, there's another grid (datasource Table B) filtered by the date inputs from Form B.

So far, for both menuitembutton in Form A & Form B, I set these properties:

AutoRefreshData = Yes

NeedsRecord = Yes

Datasource = Table A

OpenMode = Edit

CopyCallerQuery = Yes

AutoDeclaration = Yes

By this I achieved what I want in Section 1, to edit the selected grid record. No coding.

My problem is to pass the selected grid record  together with the date inputs for filtering in Section 2.

I'm aware of Args class for passing parameters. But In Form B, how can I:

1. Get the received records from Form A,

2. Combine the records with the date inputs together in a single args,

3. then pass them to Form C,

4. and finally separate them for different usage in different section of the form.

Thank You.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,381 Most Valuable Professional on at

    You can get the caller record by element.args().record().

    In object-oriented programming, objects are the primary way to combine multiple values for message passing.

    Nevertheless implementing business logic as a sequence of forms calling each other is always a bit suspicious. Consider building the business logic as a class that opens some forms when needed. The class itself will hold the data.

  • HAIRUL HAZRI Profile Picture
    1,214 on at

    Hi Sukrut,

    so tableA = element.args().record() will get the record from form A. I get that. But that's only for tableA records.

    So how to pass tableA and date together to Form C?

    Since tableA & date are two different objects,  I'm confused on how to combine and then pass them as a single args instance.

  • Verified answer
    Martin Dráb Profile Picture
    239,381 Most Valuable Professional on at

    Create a class holding the record and your "date inputs". Create public parm methods so you can set and read the values. Create a new instance of the object, set the values and pass the object to the target object (which is Form C in this particular case).

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You have multiple solutions for that, it depends on the situation and also the design best practices of your company on how to implement it.

    When you click a button the record is already saved, which means you could fetch it from the table. If there are relations between the tables on your parent and child form, record could be automatically filtered based on the datasource caller context of the menuitem button, so might not have to do anything at all if you have designed your table structure correctly.

    You may use a class that holds such values for you as Martin suggested if you cannot rely on relations. You may use other ways of storing such information as well such as a table, or the global cache - again, depending on what exactly are you trying to do.

  • Verified answer
    HAIRUL HAZRI Profile Picture
    1,214 on at

    Hi Martin.

    I created a container class to store the date inputs.

    Then I set the args.parmObject & args.record: 

    args.parmObject(conClass_Obj);
    args.record(element.args().record());

    Works like a charm. Thank You!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans