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

Notifications

Announcements

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)
  • @rp@n Profile Picture
    30 on at

    No Mohit, I already replied

  • @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!

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

    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

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

  • @rp@n Profile Picture
    30 on at

    you mean to say

    RecId     recId;

    recId = contract.parmRecId();

    is it correct?

  • @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!

  • 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 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!

  • @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

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 503 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 288 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans