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

Notifications

Announcements

No record found.

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.

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    Do you use currpage.update();

    docs.microsoft.com/.../update

  • adams1124 Profile Picture
    237 on at

    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.

  • Lars Lohndorf-Larsen Profile Picture
    on at

    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

    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?

  • Verified answer
    YUN ZHU Profile Picture
    95,595 Super User 2025 Season 2 on at

    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

    Thank you very much, Yun.

    YES, it works now in my extension.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans