Skip to main content

Notifications

Announcements

No record found.

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

  • 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,788 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans