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

Disabling a page

(0) ShareShare
ReportReport
Posted on by 213

Hello All,

Right now, am trying to Disable a page if the user changed the Status as "Completed", then it should disable for all the users except one User group. If the status was completed, then if any of the users enter to the particular page, it should display who has changed the status and when it was completed.

Now, first part i was completed. Means while changing the Status the page is disabling, But the issue facing is

a)  lines of items and Header menus are not disabled for that particular page and if we click on next and coming back at that time sometimes its not disabling.

b) Name and time Label of the status changed was not getting. 

Kindly requesting your valuable suggestion which i will get desired output

8004.jobss.jpg

pageextension 62001 "Jobs PageDisable" extends "Job Card"
{

    trigger OnOpenPage();
    var

        UserGroupMember: Record "User Group Member";
    begin

        If Rec.Completed then begin
            IF not UserGroupMember.Get('ADMIN', UserSecurityId(), CompanyName) then begin
                CurrPage.Editable := false;
            end
            else
                CurrPage.Editable := true; 
        end; 
    end;

    trigger OnValidate();
    var
        myInt: Integer;
        Confirm: Label 'The Job No :%1  Has been Closed by the User : %2 On Date %3.';
    begin
        If Rec.Completed then begin
            IF not UserGroupMember.Get('ADMIN', UserSecurityId(), CompanyName) then begin
                If Dialog.Confirm(StrSubstNo(Confirm,Rec."No.", Rec.SystemModifiedBy, Rec."Last Date Modified"), false) then begin
                    CurrPage.Update();
                end

            end;
        end;



}

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    www.dynamicsuser.net/.../14

    I will open this up to the community in case they have something to add.

    Thanks.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    I think you should try to solve this using a security filter instead.

    You can read more about how they work here:

    docs.microsoft.com/.../security-filters

  • Suggested answer
    YUN ZHU Profile Picture
    98,464 Super User 2026 Season 1 on at

    Hi, Just a little suggestion, hope this helps you.

    Regarding a, Menu cannot be Disabled, so you can prevent the user from opening this page in the program, but the disadvantage is that the user cannot confirm the page data in the case of Completed. If you have specific actions you don't want the user to run, you need to add control code to OnBeforeAction trigger of the menu.

    As for Next and Coming Back, please try adding the control code to the OnNextRecord (Page) Trigger.

    pastedimage1655857156001v1.png

    Regarding b, there is no OnValidate() in the trigger of the page, I'm not sure how you got it to compile.

    pastedimage1655857500340v2.png

    pastedimage1655857521357v3.png

    PS: If you want to determine whether the user is a Super user, you can refer to the following method.

    https://yzhums.com/25886/

    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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,850 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,084 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans