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

use internal class in your customized module

(0) ShareShare
ReportReport
Posted on by

I have a case where I need to call the the following line of code in a class in my customized module :

HcmFeatureStateProvider::isFeatureEnabled(HRUserExperienceFeature::instance());

I face the following error : The method 'instance' contained in the non-public class 'HRUserExperienceFeature' is inaccessible. 

I notice that the class is defined  in Human resources  platform module and it is called in a form exists in personnel management module . How can I can I call this method similar to  the case I notice in the standard code 

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,734 Most Valuable Professional on at

    You can't. The whole point of using an internal keyword is preventing code in other packages to use such a method. You'll need to look for a different solution.

    Because this question is clearly about F&O, I'm going to move it from Dynamics AX Forum to Dynamics 365 Finance Forum.

  • maram fraij Profile Picture
    on at

    How the standard calls this class from another module even it is internal 

  • Martin Dráb Profile Picture
    238,734 Most Valuable Professional on at

    Where do you see such a call?

  • maram fraij Profile Picture
    on at

    In the form (HcmWorkerNewWorker) exists in module (Personnel management ) , we have the following line of code in the body of the class

    private boolean isHRUserExperienceFeatureEnabled = HcmFeatureStateProvider::isFeatureEnabled(HRUserExperienceFeature::instance());

    Both class (HcmFeatureStateProvider) and class (HRUserExperienceFeature) are in module (Human resources plat form ) and both they are defined as internal

  • Martin Dráb Profile Picture
    238,734 Most Valuable Professional on at

    This is a special case. If you look at parameters of Human Resources Platform model, you'll see that it states PersonnelManagement as a "friend" package. It means that it allows PersonnelManagement to use its internal members.

    It won't help you, because you aren't allowed to change configuration of Microsoft packages.

  • maram fraij Profile Picture
    on at

    I am thinking about creating a new customized package inside personnel management package but I cannot find it , do you have an idea ?

    3108.Untitled.png

  • Martin Dráb Profile Picture
    238,734 Most Valuable Professional on at

    This isn't possible. You aren't allowed to change PersonnelManagement package. Only Microsoft could do it.

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... 577 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans