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

Community site session details

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

How to get class contract parameter value in another class ?

(0) ShareShare
ReportReport
Posted on by 229

Hi all,

I'm working on a report Cust Aging report and i customized it with a new parameter.

In DP class i m able to get this parameter value.

How could i get it also on another class used on my report ?

Regards.

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: How to get class contract parameter value in another class ?

    Hi Awaxx,

    If you are calling another class inside the DP class - You can create one parm method in the another class and pass the value to that parm method - Inside that class, you can use that parm method.

    Thanks,

    Girish S.

  • Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: How to get class contract parameter value in another class ?

    Hi, Can you provide more information about the other class. Is that class initialized in CustAgingDP class.

  • Awaxx Profile Picture
    229 on at
    RE: How to get class contract parameter value in another class ?

    Thank you first

    Then Could you elaborate please ? Do you have an example to follow ?

  • Awaxx Profile Picture
    229 on at
    RE: How to get class contract parameter value in another class ?

    Hi Mohit Rampal

    I'm trying to use this parameter from CustAgingDp  on CustAgingCalculation extension

    Regards

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: How to get class contract parameter value in another class ?

    It's similar to calling contract class inside the DP class to get the values.

    Create one parm method in another class - Assign the value to that parm method inside the DP class.

    Thanks,

    Girish S.

  • Awaxx Profile Picture
    229 on at
    RE: How to get class contract parameter value in another class ?

    Hi GirishS 

    Not very sure how to link CustAging DP class to my CustAgingCalculation Extension with parameters

    I tried something i found like this :

    public class MyClass
    {
        // Declare the parm method
        public void parmMyParameter(str _myParameter)
        {
            // Assign the parameter value to a class member variable or use it as needed
            this.myParameter = _myParameter;
        }
    
        // Class member variable to store the parameter value
        private str myParameter;
    }
    
    And use that like here :
    
    
    MyClass myObject = new MyClass();
    
    // Set the parameter value using the parm method
    myObject.parmMyParameter("Hello World");
    
    // Get the parameter value using the parm method
    str parameterValue = myObject.parmMyParameter();
    

    But need to pass many arguments in new method to reach directly my extension class but not accessible on DP class but i m not sure

    I will dig again

    Regards

  • Awaxx Profile Picture
    229 on at
    RE: How to get class contract parameter value in another class ?

    Hi guys i tried many things but still not reach my goal

    Could someone help ?

  • Arunraj Rajasekar Profile Picture
    1,743 on at
    RE: How to get class contract parameter value in another class ?

    Hi Awaxx,

    Can you elaborate on how you are trying to use CustAgingCalculation class with CustAging DP class, that will help us to give more suggestion on linking the two classes

  • Awaxx Profile Picture
    229 on at
    RE: How to get class contract parameter value in another class ?

    Hello arunraj

    I need to use a field input (dimension) given by class DP and the contract variable on custagingcalculation class and preprocess method to delete transaction which dont have the input value.

  • Arunraj Rajasekar Profile Picture
    1,743 on at
    RE: How to get class contract parameter value in another class ?

    is custagingcalculation an extension class you created for CustAging DP?

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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 585 Most Valuable Professional

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 565

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans