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

Community site session details

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

Error Message: Sorry, the current permissions prevented the action - when test run

(1) ShareShare
ReportReport
Posted on by 104

Hi. After update the BC version to 'current evaluate' I have big problem with my tests. In many situations I get an error related to permissions - for example:

Error Message: Sorry, the current permissions prevented the action. (TableData Locations Management Insert: TestsApp)

This error occurs when test app try to Insert new Locations Management record in Test Codeunit. I have no idea why.

- I run test as user with SUPER permissions

- In effective permissions tabledata 'Locations Management' have all permissions (insert etc) checked

- In properties of test Codeunit I add the line:

    Permissions = tabledata "Locations Management" = RIMD

What more can I do in this situation? I get the same error with some standard objects - like User table.
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    93,654 Super User 2025 Season 2 on at
    RE: Error Message: Sorry, the current permissions prevented the action - when test run

    Hi, Do you generate the permission set for the TestApp?

    pastedimage1665705266734v1.png

    PS: al.generatePermissionSetForExtensionObjects is a new command in Business Central 2022 wave 2 (BC21)

    More details: https://yzhums.com/29221/

    Then assign this permisson set to user, and try again.

    A simple example:

    pastedimage1665705482281v2.png

    Hope this helps.

    Thanks.

    ZHU

  • greex Profile Picture
    104 on at
    RE: Error Message: Sorry, the current permissions prevented the action - when test run

    Thank you for your reply!

    Unfortunatelly - still not working. I assigned permissions in permission set file (using the new command), but I got the same error.

    In 'effective permissions' table I checked that I have permissions to insert into this table.

  • greex Profile Picture
    104 on at
    RE: Error Message: Sorry, the current permissions prevented the action - when test run

    In previous version of BC tests work correctly.

  • Suggested answer
    YUN ZHU Profile Picture
    93,654 Super User 2025 Season 2 on at
    RE: Error Message: Sorry, the current permissions prevented the action - when test run

    Hi, if you are using the On-Pre version, this may be a license issue.

    I'm not sure if this is relevant, you can find some details in the MS Yammer link below.

    https://www.yammer.com/dynamicsnavdev/threads/1944546333016064

    pastedimage1665728300688v1.png

    Hope this helps.

    Thanks.

    ZHU

  • RoelS Profile Picture
    35 on at
    RE: Error Message: Sorry, the current permissions prevented the action - when test run

    Hi Greex,

    I'm running into the same problem. Did you find a solution yet?

    Best regards,
    Roel

  • greex Profile Picture
    104 on at
    RE: Error Message: Sorry, the current permissions prevented the action - when test run

    twitter.com/.../1582747210013605888

  • Verified answer
    RoelS Profile Picture
    35 on at
    RE: Error Message: Sorry, the current permissions prevented the action - when test run

    Thanks Greex, very helpful!

  • Suggested answer
    yannstlo Profile Picture
    116 on at
    Error Message: Sorry, the current permissions prevented the action - when test run
    I was helping a co-worker with the same issue today and resolved it by adding the following to the top of the Test Codeunit...
    TestPermissions = Disabled;

    I read through this post and tried what ZHU suggested but it did not help.
    Went back to google and found this page which gave me the solution...
    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-testpermissions-property

    Yann

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,106

#2
YUN ZHU Profile Picture

YUN ZHU 1,752 Super User 2025 Season 2

#3
OussamaSabbouh Profile Picture

OussamaSabbouh 1,670

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans