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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Updating field value on first form by a button click event on another form

(0) ShareShare
ReportReport
Posted on by

Hi All,

I'm new to AX and need your help in understanding basics.

I have 3 forms Form A,Form B,Form C. There is a menu item button on 'form A' which opens 'Form B' and likewise 'Form B' opens 'Form C'.

Now,there is a OK button on Form C , I want to update the value of Form A if I click the OK button on Form C.

please help me with basic idea that how it can be achieved.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    element.args().caller() returns you object that called the form, so element.args().caller() for Form C will return you form B, then you can grab caller of the caller and get Form A. On form A you have to have a method or something that can update your field, or you will have to grab cursor of datasource from Form A and update it.

  • Community Member Profile Picture
    on at

    Thanks for your quick response,Ivegen.

    Can you please shed some more light by giving an example of how can I grab caller of the caller.

    Your help means a lot to me .

  • Community Member Profile Picture
    on at

    Also,how can I grab cursor of datasource from Form A and update it.

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    Once you have a handle to formRun A, just call method dataSource of it.

    For example 

    FormDataSource myFormADataSource = formRunA.dataSource("MyDataSourceName");
    MyTable myTable = formRunA.dataSource("MyDataSourceName").cursor();
    
    ttsbegin;
    myTable.selectForUpdate(true);
    myTable.Field1 = "foo";
    myTable.update();
    ttscommit;
    
    myFormADataSource.refresh();
    myFormADataSource.research(true);

  • Blue Wang Profile Picture
    on at

    Hi Roshni,

    You can refer this thread: https://community.dynamics.com/ax/f/33/t/214344

    About Args, you can get more information: https://docs.microsoft.com/en-us/previous-versions/dynamics/ax-2012/system-classes/gg802600(v=ax.60)

    I hope it will help 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans