BC API Company reference in url

massive_cava@hotmail.it
Member Posts: 16
Dear NAV & BC experts,
i have a Businnes Central 14 implementation, i have a problem when referencing API url exposed by BC. I've configured all OData parameter in sertvice configuration (except Company Default Name).
When is use, for example, an out-of-the-box API such as payment method, in order to retrive all data i use the following URL
http://servername:portId/ServiceName/api/beta/companies(CompanyId)/paymentMethods/
The problem is that in the Company Table, all companies have Id fierld with "id":"00000000-0000-0000-0000-000000000000"

Since this environment has been uipgraded from an older version (NAV 2016) probably during upgrade some step have been missed.
In order to resolve this, what do you sugfgest? Is there any way to recalculate ID in Company table?
Thanks all
i have a Businnes Central 14 implementation, i have a problem when referencing API url exposed by BC. I've configured all OData parameter in sertvice configuration (except Company Default Name).
When is use, for example, an out-of-the-box API such as payment method, in order to retrive all data i use the following URL
http://servername:portId/ServiceName/api/beta/companies(CompanyId)/paymentMethods/
The problem is that in the Company Table, all companies have Id fierld with "id":"00000000-0000-0000-0000-000000000000"

Since this environment has been uipgraded from an older version (NAV 2016) probably during upgrade some step have been missed.
In order to resolve this, what do you sugfgest? Is there any way to recalculate ID in Company table?
Thanks all
OC
0
Best Answer
-
Hello, faced similar issue and finally added "OnAfterInsert" guid value to systemId. As i remember its all becouse of service setup:
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/configure-server-instance
Search for "Integration Records Table (ID)"
1
Answers
-
The API does not refer to the ID field, it refers to the SystemID field. This is a system field, you will not see it in the table designer. The 'ID' field with field number 8000 is obsolete now, don't use it.
I wrote about this last year (here: http://thedenster.com/use-systemid)0 -
Hello Daniel, thank you for your response, i didn't knwo about new field SystemId, i've read your post on your blog, that is a very useful information.
But in my case, if i try to inspect pages such customer and company, i don't have any field called Systemid (i don't have neither $system created at, $system created by$ etc). Maybe that is due to the version i am using (Business Central 14, spring 2019 on-premise), can you tell me from whichBC version the field SystemId has been introduced?OC0 -
Oh right, yeah you're right that was probably in a later version. I'd have to look that up, but if that doesn't show up in the page inspector then it's not there (obviously). I didn't start working with the API until then, I'm actually surprised that it would work with that ID field at all. Not sure if there is a process that fills in those ID values, I don't have a v14 environment at the moment
Have you tried asking on Twitter or in Discord?1 -
Hello, faced similar issue and finally added "OnAfterInsert" guid value to systemId. As i remember its all becouse of service setup:
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/configure-server-instance
Search for "Integration Records Table (ID)"
1 -
Thanks Agannalo, that is somenthing if was looking for. I will to set that configuration on the next upgrade i am going to have
BROC0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions