web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Sorry, the current permissions prevented the action. (Codeunit, D365 BC API)

(1) ShareShare
ReportReport
Posted on by 9
Hi,
I tried to publish a webservice. The object is a simple code unit with following content:

codeunit 80004 TutorialAPI

{

    procedure Hello(): Text

    begin

        exit('Hello World');

    end;

}

The Azure Active Directory App has got following user groups and permissions:

A POST to https:/api.businesscentral.dynamics.com/v2.0/{{Tenant-ID}}/{{Env_Name}}/ODataV4/TutorialAPI_Hello  without any json payload will bring up following error with status code 400 bad request and message:

 

{
    /error/: {
        /code//Internal_ServerError/,
        /message//Sorry, the current permissions prevented the action. (CodeUnit TutorialAPI Execute: )  CorrelationId:  d335ed99-1ac4-4029-9815-f9048e8d05d7./
    }
}
 
I can't figure out what the problem might be. Hopefully someone has an idea.
 
Greatings
Jannis
I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    98,819 Super User 2026 Season 1 on at
    Hi, it looks like you didn't generate the permissions file for your extension. More details: https://yzhums.com/29221/
    For exmaple,
     
    Also, this is required in a production environment.
     
    Hope this helps.
    Thanks.
    ZHU
  • j_ha_e Profile Picture
    9 on at
    Hi Yun Zhu,
    thanks for your quick response. I tried it as the article suggest it with the following permission set:

    permissionset 80000 GeneratedPermission

    {

        Assignable = true;

        Permissions =

            codeunit TutorialAPI=X;

           

    }

    And assigned it to the Azure Application:
    Unfortunately the result ist the same:
     
    {
        "error": {
            "code""Internal_ServerError",
            "message""Sorry, the current permissions prevented the action. (CodeUnit TutorialAPI Execute: )  CorrelationId:  2c526749-1586-490a-8331-cfd04f9abae7."
        }
    }
     
    Is there a step I missed out?
  • j_ha_e Profile Picture
    9 on at
    Hi Yun Zhu,
    now it works. I re-added the permission in the permission sets of the app user without a specific company.
    Thanks for your help.
     
    Greetings 
    Jannis

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,675 Super User 2026 Season 1

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,675 Super User 2026 Season 1

#3
YUN ZHU Profile Picture

YUN ZHU 964 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans