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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Error occurring creating invoice when assigning a value to globalDimension1Code

(0) ShareShare
ReportReport
Posted on by 20

I'm getting the following error when trying to assign a value to globalDimension1Code on an invoice create. The create works fine when that field is omitted but I need the value to be assigned (it's connected to the BU in the app).

status: 404
message: {"error":{"code":"Internal_RecordNotFound","message":"The Sales Header does not exist. Identification fields and values: Document Type='Invoice',No.='115055515'  CorrelationId:  433de58d-1663-4934-a8a4-49e38754dc21."}}

I'm posting to this URL for the invoice create:

api.businesscentral.dynamics.com/.../salesInvoices

This is content of my invoice:

{
  "number": "115055515",
  "invoiceDate": "2023-03-08",
  "customerId": "7e2759a8-37bd-ed11-9a88-000d3a363d43",
  "dueDate": "2023-04-22",
  "externalDocumentNumber": "7674307",
  "shortcutDimension1Code": "10"
}



I have the same question (0)
  • Pat Arneson Profile Picture
    20 on at

    I realized I put the wrong thing in the subject of my post, it's shortcutDimension1Code, not globalDimension1Code. I copied that out of my code during a test before I changed it back to shortcutDimension1Code.

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    Hi,

    One solution of this problem is that you insert Sales Invoice without shortcutDimension1Code and get id and if-Match (etag) of inserted document from response.

    pastedimage1678303370290v1.png

    Then send another Patch request by appending that id in URL as api.businesscentral.dynamics.com/.../salesInvoices(id of inserted invoice) and using If-Match (available in response) parameter and body like

    {

     "shortcutDimension1Code": "ADM"

    }

    Other way is to use deep insert.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans