Skip to main content

Notifications

Community site session details

Community site session details

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

Switching a page to non-editable

(0) ShareShare
ReportReport
Posted on by 237

Hi

I would like to 1. update some fields on a page  2. switch the page to non-editable  at the same time by one action.

If I proceed like:

  Step 1  update fields and change EDITABLE property within one action

  Step 2  close the page

  Step 3  reopen the page

the page becomes non-editable. But I would like to make the page non-editable already at the end of Step 1 like pressing the pencil (or crayon) icon.

Is it possible?

Please advise.

Thank you.

Thank you.

  • adams1124 Profile Picture
    237 on at
    RE: Switching a page to non-editable

    Thank you very much, Yun.

    YES, it works now in my extension.

  • Verified answer
    YUN ZHU Profile Picture
    81,550 Super User 2025 Season 1 on at
    RE: Switching a page to non-editable

    Hi, A very simple example, hope to give you some inspiration.

    pastedimage1628730523652v1.png

    [View:/cfs-file/__key/communityserver-discussions-components-files/758/Test0812.mp4:1013:760]

  • adams1124 Profile Picture
    237 on at
    RE: Switching a page to non-editable

    Thank you very much, Lars.

    The prototype is amazing and I did not know that we can change the property like that.

    However, I should have told that I am trying to do this with a Page Extension. I have learned that the Editable property of the entire Page cannot be changed in an Extension.

    So I could only close the Page in question and reopen it to reflect the change to the Editable property?

  • Lars Lohndorf-Larsen Profile Picture
    on at
    RE: Switching a page to non-editable

    Hello,

    Below is a prototype only of a page with two fields. If you enter something beginning with 'E' (case sensitive) in field 2, then the two fields go Uneditable. You can make them re-editable again from the Actions. It's setting editable on a group scope as opposed to the whole page. I hope that gives some ideas?

    page 50107 TestEditable
    {
        PageType = Card;
        ApplicationArea = All;
        UsageCategory = Administration;

        layout
        {
            area(Content)
            {
                group(GroupName)
                {
                    Visible = IsVisible;
                    Editable = IsEditable;

                    field(F1; F1{ ApplicationArea = All; }
                    field(F2; F2)
                    {
                        ApplicationArea = all;
                        trigger OnValidate()
                        var
                            myInt: Integer;
                        begin
                            if CopyStr(F2, 1'E' then
                                IsEditable := false;

                        end;
                    }

                }
            }
        }

        actions
        {
            area(Processing)
            {
                action(ActionName)
                {
                    ApplicationArea = All;
                    Caption = 'Make Editable';

                    trigger OnAction()
                    begin
                        IsEditable := true;

                    end;
                }
            }
        }

        trigger OnOpenPage()
        var
            myInt: Integer;
        begin
            IsVisible := true;
            IsEditable := true;

        end;


        var
            myInt: Integer;
            F1: Text;
            F2: Text;
            IsVisible: Boolean;
            IsEditable: Boolean;
    }
  • adams1124 Profile Picture
    237 on at
    RE: Switching a page to non-editable

    Thank you, Josh.

    Yes, I tried and currpage.update() only becomes effective when the page is reopened.

    I wonder if there is any other way.

  • Suggested answer
    JAngle Profile Picture
    83 on at
    RE: Switching a page to non-editable

    Do you use currpage.update();

    docs.microsoft.com/.../update

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,161 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,942 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans