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, ...
Unanswered

Global Class Instance

(0) ShareShare
ReportReport
Posted on by 165

Hello all,

I created a new class which has parmMethods.

There are 2 class that will work on the 'new class': Class A and Class B.

In class A, it will add values to the parm method of the new class, in which I also create an instance of the new class.

In class B where the process will end, I will call the new class' run method to do a process using the values passed in its parm methods from Class A.

But I think it's overwriting the instance of the new class when it reaches class B, is there a way I can create an instance of the new class global so it won't overwrite the instance created from Class A? 

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

    Hi mrpequit,

    You are using "Class B 'only to call the "new class" other then that "class B" wont have any functionality I guess.

    In that case you can directly call the new class run method from class A.

    This is my suggestion.

    Thanks,

    Girish S.

  • mrpequit Profile Picture
    165 on at

    Hi Girish,

    Yes I can do that but Class A is used by multiple process and only in Class B can I specifiy if its the right caller. I also made a switch for the development but I think it's not enough to validate if the process originates from the intended source.

  • GirishS Profile Picture
    27,843 Moderator on at

    Hi mrpequit ,

    In that case you need to go for inheritance.

    So the class B will extends class A .

    In class A you will initialize objects for new class - Assign values to new class parm methods.

    In class B you can use the new class instance since it extends class A.

    Thanks,

    Girish S.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 694

#2
André Arnaud de Calavon Profile Picture

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

#3
CP04-islander Profile Picture

CP04-islander 337

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans