web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

how will I pass Recid of active record in Controller class and then in RDP class.

(0) ShareShare
ReportReport
Posted on by 30

Hi All,

In form grid I have record. for example 2 lines are there as below

pastedimage1683572881488v1.png

And One Print buton is there to print the report based on current record selection.

I mean If I select the 1st record , it should print the first record only. I mean 04/19/2023

If i select the 2nd record, it should print the second record only . I mean 05/08/2023

for this I need to get Recid of active record.

Kindly let me know how will I pass Recid of active record in Controller class and then in RDP class.

Please give me more shed on this.

thanks!

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,833 Moderator on at

    Hi,

    Refer to the below blog it will help you.

    https://msdynamics.nevoitech.com/microsoft/running-an-ssrs-report-from-the-selected-record/

    On the main method of the controller class call the parmArgs method with the argument of main method which is also an Args where you will get the selected record.

    Thanks,

    Girish S.

  • @rp@n Profile Picture
    30 on at

    Thanks Girish,

    Actually I tried yesterday and got an error in parm method for recid while posted this. Most probably [datamemberattributes('Recid')]

    Kindly send me the code of parmrecid method and in main method what to do.

    Pls give me more shed on this

  • @rp@n Profile Picture
    30 on at

    Hi Girish,

    Contarct class

    [ExtensionOf(classStr(SalesInvoiceContract))]
    final class SalesInvoiceContarct_Extension
    {
        public  IdentifierName  callerName;
        public  RecId           recId;
    
        [DataMemberAttribute('Callerselection')]
        // Use this parm method to get the caller menu item name.
        public IdentifierName parmCallerName(IdentifierName _callerName = callerName)
        {
            callerName = _callerName;
            return callerName;
        }
    
        [DataMemberAttribute('RecId')]
        // Use this parm method to get the recId
        public RecId parmRecId(RecId _recId = recId)
        {
            recId = _RecId;
            return recId;
        }
    }

    Controller class

    protected void prePromptModifyContract()
        {
            SalesInvoiceContract contract   = this.parmReportContract().parmRdpContract();
            contract.parmCallerName(this.parmArgs().parm());
    
            if(this.parmArgs().dataset() == tableNum(CustInvoiceDuplicateTable_W))
            {
                CustInvoiceDuplicateTable_W custInvoiceDuplicateTable = this.parmArgs().record() as CustInvoiceDuplicateTable_W;
                contract.parmRecId(custInvoiceDuplicateTable.RecId);
            }
    
            next prePromptModifyContract();          
         }

    Kindly let me know what to do now in main method in controller class?

    Pls give me more shed on this.

    thanks!

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, You don't need to do anything in main method as you are getting RecId in prePromptModifyContract. Create Coc for processReport method for SalesInvoiceDP class and try adding below code and check if you are getting Recid in DP class.

    public RecId parmRecId; //Global variable
    
    public void processReport()
    {
        this.parmRecid = contract.parmRecId();
        
        next processReport();
    }

  • @rp@n Profile Picture
    30 on at

    Hi Mohit,

    this.parmRecid = contract.parmRecId();

    I am not getting this.parmRecId.

    pls give me more shed on this.

    thanks!

  • @rp@n Profile Picture
    30 on at

    you mean to say

    RecId     recId;

    recId = contract.parmRecId();

    is it correct?

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Yes, Public RecId parmRecId will be at top of your extension class.

  • @rp@n Profile Picture
    30 on at

    Hi Mohit,

    I tested with 1st record but got the RecId  = 0

    Is it because of I not declared recId as public?

    Or any other reasons?

    pls give me more shed on this.

    thanks!

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    No, it won't be because of that, Are you getting buffer in custInvoiceDuplicateTable in prePromtModifyContract method?

  • @rp@n Profile Picture
    30 on at

    Hi Mohit & Girish

    I debugged the below code

    pastedimage1683604224902v1.png

    It not getting in to the if condition.

    pastedimage1683604321650v2.png

    Pls give me more shed on this.

    thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 510 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 399

#3
Adis Profile Picture

Adis 251 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans