Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Hiw to get caller form name in RDP class in ssrs report

(0) ShareShare
ReportReport
Posted on by 6

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!

  • @rp@n Profile Picture
    6 on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    I already passed in controller main method

  • @rp@n Profile Picture
    6 on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    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
    }
    
    

  • Mohit Rampal Profile Picture
    12,556 Moderator on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    Please update here, if you fix it and can access CustInvoiceJournal menu item. It might help someone in future.

  • @rp@n Profile Picture
    6 on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    No, I need to pass CustInvoiceJournal only.

    thanks a lot Mohit & Girish for your support

  • Mohit Rampal Profile Picture
    12,556 Moderator on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    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.

  • @rp@n Profile Picture
    6 on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    the caller is CustInvoiceHJournal but the menu item type is display 

    pastedimage1682324836610v1.png

    So, I mentioned 

    menuItemName = contract.parmAmicisManuItenName();
               
                if (menuItemName == menuItemDisplayStr('CustInvoiceJournal'))  // caller name
                {
                    // to do
                }

    pls give me more shed on this.

    thanks!

  • Mohit Rampal Profile Picture
    12,556 Moderator on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    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.

  • @rp@n Profile Picture
    6 on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    In DP class should be like this

    menuItemName = contract.parmAmicisManuItenName();
               
                if (menuItemName == menuItemDisplayStr('CustInvoiceJournal'))  // caller name
                {
                    // to do
                }

    is it correct?

  • Mohit Rampal Profile Picture
    12,556 Moderator on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    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.

  • @rp@n Profile Picture
    6 on at
    RE: Hiw to get caller form name in RDP class in ssrs report

    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?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,001 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,833 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans