Back

You must specify an Id or Document Id to get the lines – How to Fix

Published: Sep 19, 2025
Post Author Written by Amit Chaudhari

When creating a transaction in Dynamics 365 Business Central with a header and line relationship (in the nested objects scenario), you may see the following error if you try to integrate line details using the Business Central OData API destination.

Error: You must specify an Id or Document Id to get the lines.

Cause

In the Business Central OData API destination, the line mapping does not include the required reference to its parent document. The “header create” call returns an ID for the new document, and the line entity must use that value (for example, Documentid/Parentid).

Simply adding a child endpoint does not relate the records automatically; you must capture the header ID and pass it explicitly in the line mapping – specify an ID.

Resolution

To fix this, map the Document ID at the line level from the parent source column.

Documentation on header-line linking can be found here.


For example, consider the following:

  1. Go to the header endpoint > click on the three dots (…)
  2. Add the id field to capture the newly generated header
  1. Open the line mapping
  2. Locate the documentId field and change the Column Type to Parent Source Column
  3. Map the parent field {HeaderObject}_ID.

Have questions? Please reach out to us at support@eonesolutions.com

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.