In this post, I want to share a developing error handling of Business Central, insufficient permissions error on publishing extension. I believe that many developers have encountered this problem while developing, hope this can help you.
When you publish an extension and a permission error occurs, the following error message will be displayed first.
Could not publish the package to the server. See Visual Studio Code debug console for more details.
Then you can see more detailed information in DEBUG CONSOLE.
Reason: You do not have the following permissions on TableData Published Application: IndirectInsert.
Reason: Could not install the extension ‘TestApp’ by ‘Default publisher’ (version ‘188.8.131.52’) on tenant ‘msft1a6720t41355303’ and company ‘My Company’ due to the following error: ‘You do not have the following permissions on TableData Customer: Insert.
This problem is mostly caused by insufficient permissions for the user used to publish the extension.
So, how to handle this error?
You can follow the point below to solve this error.
1. Check that user has the D365 EXTENSION MGT permission set assigned.
For example: When publishing an extension, IndirectInsert permission of Tabledata Published Application (2000000206) is needed. Otherwise, a permission error will be reported.
2. Delete the Company Name to the Permission Sets on User Card page.
If you have multiple companies in the same environment, the Company Name field can be used to manage the permissions of which company users can access.
Therefore, when the user who publishes the extension only has the access permission of Company A, but publish the extension to Company B, a permission error will be prompted. In development, we do not need this permission control in most cases. so, you can delete the company name to access all companies.
3. Check the detailed permissions of the publishing user.
For example: ‘You do not have the following permissions on TableData Customer: Insert.
Choose Effective Permissions on User Card page.
Then, you can find the permission details of this user.
If the permissions are insufficient, you can go to the Permission Sets page to add.
4. Check the trial period of your development environment.
If you use a trial environment in Cloud, you must ensure that the environment is within the trial period. When a trial or subscription ends, you can only read the Data in BC and cannot do any insert and delete actions
The New and Delete action on the page will be greyed out.
And if you try to open Extension Management page, the following error will be displayed. It looks very much like insufficient permissions from the error message, but please note that it is not.
You can extend your trial period. Or recreate the environment.
In the notification at the top of the workspace, choose Extend Trial.
You can force Business Central to run the Extend Trial assisted setup guide by adding the ?page=1828 parameter to the URL, such as in the following example:
For More details about How to check and extend your trial period (Only for trial environment).
Hope this will help.
Thanks for reading.