Skip to main content

Notifications

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

Sorry, the current permissions prevented the action (TableData Read in codeunit)

Posted on by 38
I have created a new table where I store settings. These settings are used for posting data to an external party. For the posting I use a codeunit. But when a normal user trys to post I get an error:
Sorry, the current permissions prevented the action (TableData ....Read....)
 
In the codeunit I set the permissions RMID. But still not working. Am I missing something?
 
My table:
table 63000 /Middleware Settings/
{
    DataClassification = ToBeClassified;
 
    fields
    {
        field(1; Id; Text[200])
        {
 
        }
 
        field(2; /Host/; Text[2048])
        {
 
        }
 
        field(3; /ApiKey/; Text[100])
        {
 
        }
 
    }
}
 
 
Codeunit code:
codeunit 69002 MiddlewareApiLogicCodeunit
{
    Permissions = tabledata 63000 = rimd;
 
 procedure SendRequestToApi(jsonText: Text; endPoint: Text; method: Text) response: HttpResponseMessage
    var
        client: HttpClient;
        request: HttpRequestMessage;
        contentHeaders: HttpHeaders;
        requestHeaders: HttpHeaders;
        content: HttpContent;
        apiKey: Text;
        settings: Record /Middleware Settings/;
        apiEndPoint: Text;
    begin
 
        if settings.IsEmpty() then
            Error('No middleware settings found. Please add settings on page /Middleware Settings/');
 
        settings.FindFirst();
 
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    Sorry, the current permissions prevented the action (TableData Read in codeunit)
    Hi, it looks like you didn't generate the permission file and need to assign it to the user in User Setup.
     
    Hope this helps.
    Thanks.
    ZHU

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans