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 :
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
    485 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,556 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,028 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 877 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans