Skip to main content

Notifications

Announcements

No record found.

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? 

  • GirishS Profile Picture
    GirishS 27,816 Super User 2024 Season 1 on at
    RE: Global Class Instance

    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.

  • mrpequit Profile Picture
    mrpequit 165 on at
    RE: Global Class Instance

    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
    GirishS 27,816 Super User 2024 Season 1 on at
    RE: Global Class Instance

    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.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans