Skip to main content

Notifications

Microsoft Dynamics AX (Archived)
Suggested answer

How to get caller form name of the caller class

Posted on by 515

Hi all,

I want to know how we can get caller's caller name. e.g. On sales order we have invoice tab when you click on invoice button new form- saleseditline opens. Now i have created new custom form like sales order form , from where i wanted to call invoice functionality but with different layout of form saleseditline form (like some controls or tab are removed from saleseditline form). To achieve this i am planning to use existing saleseditline form only, (this form is being called by class which is been called by either based sales order form or custom form)here i will add condition like based on caller's caller name it will chang saleseditline form layout. Kindly let me know if we can ado this or if there is any other approach to achieve this.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get caller form name of the caller class

    Thank you

  • Brandon Wiese Profile Picture
    Brandon Wiese 17,786 on at
    RE: How to get caller form name of the caller class

    Why not just use the already present classes SalesEditLinesForm, for which there is an extended SalesEditLinesForm_Invoice already, and simply hide the tabs and controls as required on the standard forms?

  • Suggested answer
    Johnkrish Profile Picture
    Johnkrish 781 on at
    RE: How to get caller form name of the caller class

    Hi Shri,

    Please refer this post link, I hope it'll be useful.

    https://community.dynamics.com/ax/b/bedynamicfordynamics/archive/2013/05/14/find-root-caller-form

    Regards,

    Johnkrish

  • Suggested answer
    reachnaidu Profile Picture
    reachnaidu 890 on at
    RE: How to get caller form name of the caller class

    In the init method of the form , we can check who the caller was .. We can change the display accordingly

    For example in SalesEditLines,, we can have the below code.

    str callerName;

    salesFormLetter         = element.args().caller();

       if (salesFormLetter != null)

           callerName = salesFormLetter.name();

       if (callerName == 'SalesFormLetter_Invoice') // SalesFormLetter_Invoice is the menuItem that will call the SalesFormLetter

       {

      ?// Write your code 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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans