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 :
Microsoft Dynamics AX (Archived)

Calling FormA DataSource methods in formB close method

(0) ShareShare
ReportReport
Posted on by 100

Hi Friends,

I would like to pass some value to FormA datasource methods through FormB close method. For example: Am openning FormB through FormA while closing the formB i wants to passing the values to formA datasource method.

Kindly help on this. Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    zeeshan.shaikh Profile Picture
    683 on at
    RE: Calling FormA DataSource methods in formB close method

    Hi Karthickks,

    You can achieve this using the Args class and Parm method. 

    Below is just the sample code to help achieve your result, you can call FormB by using below code in any button click method of FormA.

    Str  parmArgs;
    Args args = new Args();
    
    args.record(your rable); //if required
    
    args.caller(this);
    
    args.name(formstr(SPXSalesOrderApprovedLines));
    formRun = classFactory.formRunClass( Args );
    formRun.init();
    formrun.run();
    formrun.wait();
    
    if(formrun.closed())
    {
        if(args.parm())
        {
            parmArgs = args.parm(); //This is parameter value returned from FormB
        }
    }

    You need to set args().parm in formB as well as below:

    element.args().parm( 'Form B parameter value');

    Regards,

    Ali Zeeshan

  • Karthickks Profile Picture
    100 on at
    RE: Calling FormA DataSource methods in formB close method

    Hi Ali,

    Thanks for your reply. I wants to pass parameter from FormB to FormA datasource method. not from formA to Formb

    Thanks in advance.

  • Suggested answer
    zeeshan.shaikh Profile Picture
    683 on at
    RE: Calling FormA DataSource methods in formB close method

    Hi Karthickks,

    I just showed you sample code, the statement below will set your parameter in formB

    element.args().parm( 'Form B parameter value');

    Then you can use below statement to get in formA

    if(args.parm())
    {
       parmArgs = args.parm(); //This is parameter value returned from FormB
    }

    It just need some tweak to match your requirement.

    Regards,

    Ali Zeeshan

  • Karthickks Profile Picture
    100 on at
    RE: Calling FormA DataSource methods in formB close method

    Hi Crispin,

    Thanks for help. Will try this and get back!

  • Karthickks Profile Picture
    100 on at
    RE: Calling FormA DataSource methods in formB close method

    Thanks Ali Zeeshan. Will try this!

  • Karthickks Profile Picture
    100 on at
    RE: Calling FormA DataSource methods in formB close method

    Hi  Crispin John Augustine,

    I tried but no luck, Am unble to get the FormA datasource method in  FormB.

    below is my code:

    if (formHasMethod(element.args().caller(), identifierStr(method1test)))

  • Karthickks Profile Picture
    100 on at
    RE: Calling FormA DataSource methods in formB close method

    Hi ALL,

    Finnaly got solution

    Object TABLE_DataSource ;

    TABLE_DataSource   =   Parent1.dataSource();

    if (formDataSourceHasMethod(TABLE_DataSourc, identifierStr(active)))

    ABOVE IS THE SYNTAX.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans