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

Recurring integr., batch mode: Import header only invoices?

(1) ShareShare
ReportReport
Posted on by 92
Hello.
Please, tell me if my understanding is correct?
 
1. Import of header only invoices in the batch.
    D365 required at least 1 empty(dummy) line in case of all invoices in the batch are header only.
2.  Import of mix of header only and invoices with lines in the batch.  
   If there is one invoice with real line(connected to its header by HeaderReference) in the batch, we must not place empty line for other header only invoices. If we place empty line, D365 will create all invoices without lines, even invoices that have real lines in the package.
Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    Which data entity (entities) are you talking about?
  • Andrei Profile Picture
    92 on at
    I speak about VENDORINVOICEHEADERENTITY and VENDORINVOICELINEENTITY.
  • Suggested answer
    Giorgio Bonacorsi Profile Picture
    2,013 on at
    Hello Andrei, 
     
    You can follow our way. Usually:
    1- we import the header in order to create the document in D365FO;
    2- we load the lines (but nothing forbids us to upload the header too in this step)
     
    If you load the data using a batch, ensure the header batch project runs before leading the lines. For more details about the right order to lead, you can find here the entity related to the pending vendor invoice (+ the Excel conversion file): https://daxmsdynamics365.wordpress.com/2023/11/06/pending-invoice-data-entities/
     
    Thank you, 
    Giorgio
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    1. What do you mean by "D365 required a line"? VendorInvoiceHeaderEntity imports just headers; it doesn't know or require anything about lines (as far as I know).
    2. I guess you mean a composite entity here, right? What do you mean by "an empty line"? I would say that you either add a line or not; I'm not aware of the concept of real and empty lines in data entities.
  • Andrei Profile Picture
    92 on at

    Hi,

    Let me explain a bit more detailed, please. I have an import project in D365FO with recurring job for importing of invoices.
    I send my invoices in batches via OData interface.

    For example, I want to send 2 invoices with lines in one batch:

    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>1111111-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>2222222-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
    </Document>
    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <VENDORINVOICELINEENTITY>
            <HEADERREFERENCE>1111111-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICELINEENTITY>
        <VENDORINVOICELINEENTITY>
            <HEADERREFERENCE>2222222-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICELINEENTITY>
    </Document>

    every header has its line with data. Lines are linked to headers via HEADERREFERENCE.  It works, no questions.


    Example 2. I want to send invoice "1111111" with data in the line and invoice "2222222" as header only.
    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>1111111-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>2222222-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
    </Document>
    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <VENDORINVOICELINEENTITY>
            <HEADERREFERENCE>1111111-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICELINEENTITY>
    </Document>
    In this case I don't send any lines for invoice "2222222". It works well. Invoice "2222222" will be created as header only without errors in the log.

     
    Example 3. I want to send 2 header only invoices in the batch:
    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>1111111-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>2222222-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
    </Document>
    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    </Document>
     
    In this case D365 throw an error in the log of my job, because there are no lines in the batch.
    Thus, at least  one line MUST be in the batch. 
    Question: Is it immutable behavior of D365? May be there is some setting to allow send batches without lines?

    Example 4. I want to send 2 header only invoices again, but I've added dummy(empty) line.

    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>1111111-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
        <VENDORINVOICEHEADERENTITY>
            <HEADERREFERENCE>2222222-7f43-4ad7-975d-a3f16055c470</HEADERREFERENCE>
            // Data fields
        </VENDORINVOICEHEADERENTITY>
    </Document>
    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <VENDORINVOICELINEENTITY>
            <HEADERREFERENCE></HEADERREFERENCE>
            // Empty data fields
        </VENDORINVOICELINEENTITY>
    </Document>
    In this case D365 creates 2 header only invoices without any errors in the log of my recurring job.
    Question: Is it correct way to import header only invoices, when only header only invoice are in the batch?
     
     
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    I'm confused. You mentioned a recurring integrations job and OData (your messages could be OData batches), but the recurring integrations API isn't an OData API. Please clarify that by tell us which endpoint you're calling. Maybe you're using a way that I'm not aware of.
     
    When you say "D365 throw an error in the log of my job", could you mention the error message, please?
     
    Note that if you actually use one of the data management APIs (recurring integrations or packages API), you can utilize a composite entity. It's already included in F&O; it's called VendInvoiceV2Entity.
  • Andrei Profile Picture
    92 on at
    Sorry, I mixed up with master data. Of course, I use recurring integration REST API for enqueue packages.

    The error is: "The mapping is incorrect for entity Vendor invoice line and field {C47BAF81-13EA-407E-AAAD-C655000E1FF2}."
    It happens if there are no lines in the package. 

    In fact, I have only two questions from my posting below:

    1)In this case D365 throw an error in the log of my job, because there are no lines in the batch.
    Thus, at least  one line MUST be in the batch. 
    Question: Is it immutable behavior of D365? May be there is some setting to allow send batches without lines?

    2) ... In this case D365 creates 2 header only invoices without any errors in the log of my recurring job.
    Question: Is it correct way to import header only invoices, when only header only invoice are in the batch?
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    All right, so let's forget everything you mentioned about OData.
     
    It seems that you're importing a data package, so what exactly do you have inside? Is there no file for lines? An empty file? A file with some contents?
  • Andrei_R Profile Picture
    7 on at
    Yes, I import data packages, not files. The job is configured for working with packages, as it is described here: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/recurring-integrations#create-a-recurring-data-job
     

    "so what exactly do you have inside? Is there no file for lines? An empty file? A file with some contents?"

    I posted 4 use cases with examples of content of data packages in my posting below.
     


     
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at
    A data package contains one or multiple data files (plus some metadata such as mappings) in a ZIP archive. You didn't mention files below, you just shared some texts resembling XML. Could you please tell us what data files you have in the package and what each file contains?

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
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans