Hi!
I have defined in my BC default dimension shortcut codes for Sales Header and Sales Line.
In my application, I create sales invoices and its lines from code.
Setting the dimensions for the lines works fine:
InvoiceLine. "Shortcut Dimension 1 Code" := 'VALUE1'; InvoiceLine. "Shortcut Dimension 2 Code" := 'VALUE2';
On the other hand, when I do the same for the invoice header the values do not set:
InvoiceHeader. "Shortcut Dimension 1 Code" := 'VALUE1'; InvoiceHeader. "Shortcut Dimension 2 Code" := 'VALUE2';
In the debugger, I can see that in the code the values assign correctly for these fields. However, when I go into the created invoice and select "Invoice > Dimensions" I don't see the dimensions set.
How do I assign dimensions for the invoice header from the code? :)
Best Regards
That's all my code. I'm creating new Sales Header record.
procedure fun() var InvoiceHeader: Record "Sales Header"; begin Clear(InvoiceHeader); InvoiceHeader."Dimension Shortcut 1 Code" := 'Value1'; //more fields and insert to DB end;
It would be helpful if you can show all your code to identify the issue.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156