Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Custom Codeunit Error: current permissions prevented the action

(1) ShareShare
ReportReport
Posted on by 4
I've created a codeunit to update the item journal and get the following error:
Sorry, the current permissions prevented the action. (CodeUnit 70000 CodeUnitName Execute: )  CorrelationId:  18cb24de-c54e-4678-ac89-309148d4c82d.
I've generated a permissionset.al, uploaded it and assigned the permissions to the API user and still get the above error.
 
Is this all that is needed in the permission file?
permissionset 70000 INTERNALNAME
{
    Assignable = true;
    Permissions = codeunit CodeUnitName = X;
}
 
Thanks!
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 5,234 on at
    Custom Codeunit Error: current permissions prevented the action
    if you are using other objects then you should add that in permission set.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,914 Super User 2024 Season 2 on at
    Custom Codeunit Error: current permissions prevented the action
     
    I think you're using other codeunits and other objects, so you should add them to the permissionset.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • ND-19090211-0 Profile Picture
    ND-19090211-0 4 on at
    Custom Codeunit Error: current permissions prevented the action
    Thanks for the suggestion Khushbu, but I have already generated the permission file as per the link you shared and assigned it to the user.
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 5,234 on at
    Custom Codeunit Error: current permissions prevented the action

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans