Company Guid Null !!

22. September 2021 11:08

Hi everyone,

the problem i got its when i migrated from NAV 2016 to BC14 they added a id field in company table which its used for API so when i checked my company ID it was null {00000000-0000-0000-0000-000000000000}

Can someone help me to find a way to generate that ID whitout deleting de company !!

many thanks

Re: Company Guid Null !!

22. September 2021 11:35

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/guid/guid-data-type

so maybe you should just do a CREATEGUID for the ID-Field on every Company-Record (don't forget the modify)
but for the api, in my oppinion, you can use the name

Re: Company Guid Null !!

22. September 2021 11:51

yes i tried it but it cant be modified, it got a message error that we cant change a company id, if we can call company name in api how should i call it in the param
.../demo/v1.0/companies(id)

Re: Company Guid Null !!

22. September 2021 14:43

hi,

sorry, i was wrong - looks like you can't use the name in the api + i got the same error like you on modifying the id :(.
and in my databases, the id is also "empty" - but in an upgraded db (from 2018 to bc17) it's filled.

okay, you can try to save your guid via sql, but this is...i think it's fine, but who knows!

maybe we got other ideas here

Re: Company Guid Null !!

22. September 2021 17:06

Hi,

Yeah since i upgraded from nav2016 because the ID field wasnt created yet the ID is empty.