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
Thank you
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?
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
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.
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,113 Super User 2024 Season 2
Martin Dráb 229,918 Most Valuable Professional
nmaenpaa 101,156