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...
Suggested Answer

Can't modify the Sales Cr.Memo Line (table 115) with .al code

(0) ShareShare
ReportReport
Posted on by 65

I think this is the case with the other "posted tables" as well, as I have seen a few discussions on this. This is a system permissions error, when I have the SUPER permission set, and have allocated this specific permission to my user as well. I have also generated an .al file permission set as well, with the error still presenting itself.

Please see the below code I have. I have many variations that I have tried to get the data on the Sales Cr.Memo Line to modify/update (second screenshot is the error):

On the vast majority of tables (when your user has the correct permissions) this is never an error that occurs, but on all "posted" tables this seems to be a common theme. Does anyone have a way that they have found to be able to modify data using the modify() procedure for this table or other tables that present this error when using that procedure? 

Thanks. 

action(Test)
            {
                Caption = 'Test';
                ApplicationArea = All;

                trigger OnAction()
                var
                    SalesCrMemoHeader: Record "Sales Cr.Memo Header";
                    Salescrmemolines: Record "Sales Cr.Memo Line";

                begin
                    Salescrmemolines.Reset();
                    Salescrmemolines.SetRange("Document No.", SalesCrMemoHeader."No.");
                    Salescrmemolines.SetRange(Type, Salescrmemolines.Type::Item);
                    if
                    Salescrmemolines.Findset()
                    then
                        repeat
                            Salescrmemolines."Unit Cost" := Salescrmemolines."Orbus Unit Cost";
                            Salescrmemolines."Unit Cost (LCY)" := Salescrmemolines."Orbus Unit Cost";
                            Salescrmemolines.Modify(); // this is the line where system permission error occurs
                        until
                        Salescrmemolines.Next() = 0;

                end;
            }

Screenshot-2023_2D00_01_2D00_23-171836.png

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    101,600 Super User 2026 Season 1 on at

    Hi, If you want to modify the posted data, you need to add the Permission property.

    More details: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-permissions-property

    For example in codeunit 80 "Sales-Post":

    pastedimage1674517841805v1.png

    But please note that it is very dangerous to directly modify the posted data, and it is not recommended to do this kind of processing in the code.

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,382 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,625 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,376

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans