Hi, Readers.
Today I would like to share another mini tip about Business Central, how to quickly check if the current company is a demo company.
First, there is the “Demo Company” field in table 79 “Company Information”. When you include sample data when creating a new company, or after importing a Predefined Package from Configuration Package, the company is automatically set as a demo company.
![](https://yzhums.com/wp-content/uploads/2023/11/image-9-1024x575.png)
![](https://yzhums.com/wp-content/uploads/2023/11/image-8-1024x575.png)
Demo Company: Yes
![](https://yzhums.com/wp-content/uploads/2023/11/image-6-1024x588.png)
If the company created only contains setup data, or is a completely new company, it is not a demo company (Please note that this has nothing to do with the environment type).
Demo Company: No
![](https://yzhums.com/wp-content/uploads/2023/11/image-7-1024x588.png)
If you want the code executed in the demo company to be different, Microsoft has prepared a standard method.
codeunit 1306 “Company Information Mgt.”:
![](https://yzhums.com/wp-content/uploads/2023/11/image-5-1024x281.png)
A simple example:
![](https://yzhums.com/wp-content/uploads/2023/11/image-10.png)
![](https://yzhums.com/wp-content/uploads/2023/11/image-11-1024x575.png)
Test video:
Great. Give it a try!!!😁
END
Hope this will help.
Thanks for reading.
ZHU
コメント