Hi team,
The below link mention in controller class in Ssrs report to get the caller name
How I will get this value further in RDP class in process report method?
Please give me more shed on this
Thanks!
Hi team,
The below link mention in controller class in Ssrs report to get the caller name
How I will get this value further in RDP class in process report method?
Please give me more shed on this
Thanks!
I already passed in controller main method
Sure Mohit
Repo steps -
Contract class - Add a new parameter
[ExtensionOf(classStr(SalesInvoiceContract))] final class SalesInvoiceContarct_Extension { public IdentifierName callerName; [DataMemberAttribute('Callerselection')] // Use this parm method to get the caller menu item name. public IdentifierName parmCallerName(IdentifierName _callerName = callerName) { callerName = _callerName; return callerName; } }
Controller Class -
PrePromptModifyContract -
protected void prePromptModifyContract() { SalesInvoiceContract contract = this.parmReportContract().parmRdpContract(); contract.parmCallerName(this.parmArgs().parm()); next prePromptModifyContract(); }
Main method - Passing the caller name
public static void main(Args _args) { if (_args.record() && _args.dataset() == tableNum(CustInvoiceDuplicateTable_W)) { _args.parm('CustInvoiceJournal'); // passing caller name CustInvoiceDuplicateTable_W custInvoiceDuplicateTable_W = _args.record(); } }
RDP class - Get the caller name through parm method and use further
Declare variables SalesInvoiceContract contract; contract = this.parmDataContract() as SalesInvoiceContract; IdentifierName callerName; callerName = contract.parmCallerName(); if (callerName == menuItemDisplayStr('CustInvoiceJournal')) { // to do }
Please update here, if you fix it and can access CustInvoiceJournal menu item. It might help someone in future.
No, I need to pass CustInvoiceJournal only.
thanks a lot Mohit & Girish for your support
Yes, but the issue is menu item name as CustInvoiceJournal was not passed to controller, it was SalesInvoiceOriginal that was was calling the report. So, you need to change logic in DP to check if parm has that value that means it's called from your code.
the caller is CustInvoiceHJournal but the menu item type is display
So, I mentioned
menuItemName = contract.parmAmicisManuItenName(); if (menuItemName == menuItemDisplayStr('CustInvoiceJournal')) // caller name { // to do }
pls give me more shed on this.
thanks!
No, since it is not menu item name that you are fetching now, you can change if condition as menuItemName = "Your String'
Replace Your String with the value you are setting in args.parm method.
In DP class should be like this
menuItemName = contract.parmAmicisManuItenName(); if (menuItemName == menuItemDisplayStr('CustInvoiceJournal')) // caller name { // to do }
is it correct?
I am assuming you are calling your menu item via button clicked, same as standard CustInvoiceJournal form. If yes then please add it in clicked method just before calling the menu item as shown in my screenshot shared before.
for the 1st point
I wrote in Controller class - main method
if (_args.record() && _args.dataset() == tableNum(CustInvoiceDuplicateTable_W)) { _args.parm('CustInvoiceJournal'); // caller name CustInvoiceDuplicateTable_W custInvoiceDuplicateTable_W = _args.record(); }
is it correct?
André Arnaud de Cal...
293,001
Super User 2025 Season 1
Martin Dráb
231,833
Most Valuable Professional
nmaenpaa
101,156
Moderator