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)

Is it possible to call a menu button and perform it's methods from another form?

(0) ShareShare
ReportReport
Posted on by 272

What I want to happen is to be able to create lines using the values from my customize table/form. The Add Line button will be disabled and lets the user to use my customized form to creates line in Sales Agreement.

5265.pic1.PNG

5430.pic2.PNG

My custom form is Tolling Details. A user needs to create only 1 record in this customized form. Then after clicking OK when the customize form exits, 2 record lines of Agreement Line is created based on the values in my customized form. My plan is to use args() to pass values from my form to the sales agreement form.

Is it possible to call the standard Add Line button from my customized form and instead of user inputs of some of the fields it will take values from my customized form?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    hello Miguel,

    your customised form and teh agreement line one don't have the same datasource ??

  • Miguel Zuniga Profile Picture
    272 on at

    Hi Soumaya,

    I've placed the AgreementLine and AgreementLineDefault as the data sources of my customized form.

  • Miguel Zuniga Profile Picture
    272 on at

    Hi Sukrut Parab,

    Thanks for the link! Unfortunately I cannot use the element.args().caller() because I passed a different args because I opened my formB through formRun. See my code below:

    In my formA I needed to pass a value based on a value found in SalesAgreementHeader.

    FormA:

    Args hsArgs = new Args();
    FormRun formRun;
    
    hsArgs.parm(SalesAgreementHeader_SalesNumberSequence1.valueStr());
    hsargs.name(formstr("FormB"));
    formRun = classfactory.formrunclass(hsArgs);
    formRun.init();
    formRun.run();
    formRun.wait();
    
    super();

    but my problem is, I need the method of the AgreementLine datasource which is ALine:create() in the form SalesAgreementForm form. Unfortunately when I'm passing args() I am getting values from the SalesAgreementListPage (which is the Sales Agreement Header).

    How can I call the data source method in SalesAgreementForm (AgreementLine datasource) using my customized form?

     

     I cannot use elemet.args().caller() in my customized form because I've already passed a different args as shown above. I can't send it in my formA because the caller I need is formA itself.

  • Miguel Zuniga Profile Picture
    272 on at

    Hi Sukrut,

    this worked for me:

       // Call method from calling form

       if (element.args () && element.args (). Caller () && element.args (). Caller (). Handle () == className2Id ( 'formRun' ))

       {

           formRun = element.args () caller ().

           if (sysFormRun :: hasMethod (formRun, identifierStr ( " someFormMethod " )))

           {

               object = formRun;

               object. someFormMethod () ;

           }

    however, before doing the someFormMethod() I want that the fields I placed on my customized form will be passed there. In my case I am passing to SalesAgreementForm form, and it's method createRecord()

  • Community Member Profile Picture
    on at

    if u insert in this table , records will be shown automatically ! i don't pick up the prob !

  • Miguel Zuniga Profile Picture
    272 on at

    Hi Sukrut Parab and Soumaya,

    I've asked a new question please see here.

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
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans