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"
}