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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to have an outgoing purchase invoice on e-Doc

(5) ShareShare
ReportReport
Posted on by 34
I've complained before about Microsoft making so much of the E-Document Core and other functionality internal only, but I've run into a specific problem that I don't know how to get around.
 
I need to produce outgoing E-Documents from a Purchase Invoice. This does not seem to be supported, or possible to support via an extension as per my notes below:
 
The E-Document Core uses the "E-Document Subscription" codeunit to subscribe to the After Post events, but for PO/PI, seems only interested in linking to incoming documents.
If I want to create my own subscription:
- I cannot call "E-Document Subscription".CreateEDocumentFromPosedDocument because it's internal
- I cannot call "E-Doc. Export".CreateEDocument because it's internal
 
But if I try to re-implement "E-Doc. Export".CreateEDocument
- I cannot call "E-Doc. Export".PopulateEDocument because it's local
- I cannot use any of the E-Document Processing code unit because it has Access = internal
- I cannot initiate the background job in "E-Document Background Jobs"
 
So I would have to build a whole codeunit to replicate all of these methods to achieve what I want? Providing all of the tables will let me?
Is there any other solution?
 
Thanks.
I have the same question (0)
  • Suggested answer
    Andrés Arias Profile Picture
    4,164 Super User 2025 Season 2 on at
    How to have an outgoing purchase invoice on e-Doc
    Hello,

    You may have already reviewed the following documentation:
     
     
    I hope I can help.
     
    Regards,

    Andres
  • SB-30050252-0 Profile Picture
    34 on at
    How to have an outgoing purchase invoice on e-Doc
    The documentation only refers to Incoming purchase orders. This is Outgoing, to be sent to the government when the PI is for a foreign supplier.
     
    Update:
    I did copy all the code from those methods I mentioned to a new codeunit and it works, but it's an unpleasant solution. I'd still love to know a cleaner one.
  • Verified answer
    Jainam M. Kothari Profile Picture
    12,148 Super User 2025 Season 2 on at
    How to have an outgoing purchase invoice on e-Doc
    Hello,
     
    In Business Central, generating outgoing E-Documents from Purchase Invoices is not supported, and the core E-Document functionality is mostly marked as internal, making it inaccessible for extensions.
     
    Key methods and codeunits like CreateEDocumentFromPostedDocumentCreateEDocument, and background job handlers are either internal or local, preventing developers from extending or reusing them.
     
    As a result, the only workaround is to manually replicate the entire E-Document creation and processing logic using available tables, which is complex and risky.
     
    There is currently no supported or simple solution unless Microsoft changes access levels in future updates.
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,095 Super User 2025 Season 2 on at
    How to have an outgoing purchase invoice on e-Doc
    In Business Central, generating outgoing E-Documents from Purchase Invoices is not currently supported. The E-Document Core functionality is largely marked as internal, meaning essential methods like CreateEDocumentFromPostedDocument, CreateEDocument, and background processing logic are inaccessible from extensions.
     
    Because of this, the only possible workaround is to rebuild the entire E-Document flow manually using available tables — a complex and unsupported approach that comes with risks. Until Microsoft exposes more of these internals or adds native support, there’s no clean or recommended solution for this use case.
     
    ✅ Mark this answer as verified if it helps you.
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 2,762

#2
Sumit Singh Profile Picture

Sumit Singh 2,573

#3
YUN ZHU Profile Picture

YUN ZHU 1,930 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans