Hi, Readers.
The public preview for Dynamics 365 Business Central 2023 release wave 2 (BC23) is available. Learn more: Link.
I will continue to test and share some new features that I hope will be helpful.
In this post, I would like to talk about how to retrieve the company ID. This is not yet documented in the Business Central 2023 release wave 2 (BC23) release plan. But it is mentioned in AL Language extension changelog Version 12.0
Added ID property on CompanyProperty to retrieve the company ID.
https://marketplace.visualstudio.com/items/ms-dynamics-smb.al/changelog
In Business Central, each company has an ID, which is usually used in APIs.
PS: Company Name, Company Display Name, and Company URL Name
![](https://yzhums.com/wp-content/uploads/2023/09/image-199-1024x576.png)
![](https://yzhums.com/wp-content/uploads/2023/09/image-198-1024x303.png)
In previous versions, if you needed to get the Company Id from the code, you needed to search for it in Company (2000000006) using Name.
For example,
![](https://yzhums.com/wp-content/uploads/2023/09/image-201.png)
![](https://yzhums.com/wp-content/uploads/2023/09/image-200-1024x576.png)
In this wave, Microsoft added ID property on CompanyProperty to retrieve the company ID.
CompanyProperty Data Type: Provides language support for company properties.
![](https://yzhums.com/wp-content/uploads/2023/09/image-196.png)
Very simple.
![](https://yzhums.com/wp-content/uploads/2023/09/image-197-1024x576.png)
Great. Give it a try!!!😁
PS: In previous versions
![](https://yzhums.com/wp-content/uploads/2023/09/image-202-1024x221.png)
END
Hope this will help.
Thanks for reading.
ZHU
コメント