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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to handle"xxxx" is internal and can be called only from within the same module or assembly

(1) ShareShare
ReportReport
Posted on by 405
Hi guys,
 
When trying to use this method :
         SubBillDeferralScheduleCreate::createScheduleFromCustInvoice(custInvoiceTrans.SalesId, 0, custInvoiceTrans.InvoiceId, true);
 
I'm hit this error :  Method 'createScheduleFromCustInvoice' is internal and can be called only from within the same module or assembly. 
 
May I know what is best if I still need to call or run the procedure inside ? Is by copying the method into my custom class would be fine ? or is there any other workaround ?
 
This method actually coming from Extension Class built by Microsoft self, related to Subscription Billing feature ->
internal final class SalesInvoiceJournalPostSubBill_Extension
There is one method inside the mentioned class which I would like to run as well in my custom class, specifically from this method :
private void createDeferralSchedule()    {        if (SubBillDeferralEnableFeature::isEnabled())        {            CustInvoiceJour custInvoiceJour;            ProjProposalJour projProposalJour;            SalesParmTable salesParmTable;                    if (!this)            {                return;            }            if (SubBillProjectEnableFeature::isEnabled() && (this is SalesInvoiceJournalPostProj))            {                projProposalJour = this.parmProjProposalJour();                parmJournalTableBuffer = this.parmJournalTable();                if (parmJournalTableBuffer is SalesParmTable)                {                    salesParmTable = parmJournalTableBuffer;                }                                SubBillDeferralScheduleCreate::createScheduleFromProjInvoice(salesParmTable.SalesId, 0, projProposalJour, true);            }            else            {                parmJournalTableBuffer = this.parmJournalTable();                if (parmJournalTableBuffer is CustInvoiceJour)                {                    custInvoiceJour = parmJournalTableBuffer;                }                                if (!custInvoiceJour.InvoiceId)                {                    // pro forma, no processing should be done                    return;                }                if (custInvoiceJour.SalesId != '')                {                    SubBillDeferralScheduleCreate::createScheduleFromCustInvoice(custInvoiceJour.SalesId, 0, custInvoiceJour.InvoiceId, true);                    //Create schedule for charges                    SubBillDeferralScheduleCreate::createSalesLineChargesSchedule(custInvoiceJour.SalesId, 0, custInvoiceJour.InvoiceId);                }            }        }    }
I would want my class to execute the one in last section of Else condition.
 
May I have some advice.
Thanks
 
 
  
I have the same question (0)
  • Martin Dráb Profile Picture
    240,335 Most Valuable Professional on at
    Your design is impossible to implement. Even if you could extend the method, you couldn't change its code, such as adding something to the else block. You'll need to rethink your solution.
     
    You also can't use internal members of other modules. Duplicating the method is an option if you want to call the same logic on your own and you don't have to change behavior of the method called by the system. It's still far from ideal, because you then must keep maintaining your copy when Microsoft change their code. If you want to change what happens when SalesInvoiceJournalPostSubBill_Extension calls createScheduleFromCustInvoice(), creating your own method won't help you at all, because your method won't be called there.
     
    I would start by analyzing the requirement and try to find a way how to achieve it without code that isn't accessible. If not, the next step should be asking Microsoft to make the code extensible.
  • Layan Jwei Profile Picture
    8,282 Super User 2026 Season 2 on at
    Hi Teevo,
     
    As the errors says, you can't call internal methods from a different model.
     
    It's either u duplicate the method, which means if sth is changed from Microsoft side inside this method, then u need to amend ur duplicated method to match it. Or you raise a ticket with Microsoft
     
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 286 Super User 2026 Season 2

#2
SajeedMullaji Profile Picture

SajeedMullaji 272

#3
Martin Dráb Profile Picture

Martin Dráb 258 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans