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)
Suggested Answer

How to get caller form name of the caller class

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    reachnaidu Profile Picture
    890 on at

    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.

       }  

  • Suggested answer
    Johnkrish Profile Picture
    781 on at

    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

  • Brandon Wiese Profile Picture
    17,788 on at

    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?

  • Community Member Profile Picture
    on at

    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

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