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

How to access internal methods in x++

(1) ShareShare
ReportReport
Posted on by 84
HI All,

 I’m trying to access some internal methods, but I’m getting an error saying that the method is internal and can only be called from within the same module or assembly.

How can I access internal methods? Is there any alternative way to do so?

I am trying to access below internal methods.

            EntAssetWorkOrderJournals journals = EntAssetWorkOrderJournals::construct();
            journals.parmWorkOrder(workOrder);
            journals.parmJournalIdItem(inventJournalTrans.JournalId);
            journals.parmJournalIdExpense(ledgerJournalTrans.JournalNum);
            JournalSessionId.post();

Any help or suggestion.
 
Categories:
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,734 Most Valuable Professional on at
    The error message is correct - you can't access internal methods from other modules than where the method is defined (or modules that have an explicit permissions to do so, which is mainly used for testing). This is the purpose of the internal access modifier.
     
    You either need to design your customization so it doesn't need types and methods you don't have access to, or you have to create an extensible request, ask Microsoft to allow the access and wait until it's done.
  • charanch Profile Picture
    84 on at
    Hi @Martin Dráb , thanks for replying.

    In that case , then how can we post the work order journals.
     
    Regards,
    Charan.
  • Diego Mancassola Profile Picture
    611 on at
    Hi, just simply try to search references of the internal method, i found postJournalByType of EntAssetLifecycleStateUpdate_WorkOrderTable
    May be a good method for your case?
     
    If not try explain it better you context.
  • Sohaib Cheema Profile Picture
    49,657 Super User 2026 Season 1 on at
    Hi,
    Isn’t your issue that your package is not referencing the package that contains this posting class? Could you please make sure your package has a reference to the other package (named Asset Management Dynamics 365 for Operations)?
     

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 311

#3
Diego Mancassola Profile Picture

Diego Mancassola 271

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans