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

How to hide a field in Business central through page extension

(0) ShareShare
ReportReport
Posted on by 335

I have a requirement where I want to hide Unit price field on Sales order page .Can somebody please help me how to write an extension for this.I think I can hide it based on a permissiom set,Not sure though.Please help.

pastedimage1598534275251v1.png

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    pageextension 50000 "FOO Page Extension 46" extends "Sales Order Subform"

    {

     layout

     {

       modify("Unit Price")

       {

         Visible = false;

       }

     }

    }

  • Rupali  Profile Picture
    335 on at

    Thanks alot.

    Is there anyway I can make it specific for certain number of users and meanwhile others can access it use and see these fields?

    I tried to create one profile and do it but it only modifies and hide the field for that particular profile.

  • Suggested answer
    Community Member Profile Picture
    on at

    Set the Visible property to a global variable name,, and set that variable on the OnOpenPage trigger with the logic you intend.

  • Rupali  Profile Picture
    335 on at

    I really appreciate your help.

    Below is what I have done for someone who is not a superuser,the fields shouldn't be visible to such user.

    I want For Example there 5 users in a tenant and I want only 1 user not to be able to see the "Unit Price","Unit cost" etc but other 4 users should be able to see it.

    pageextension 50110 ItemCardExtension extends "Item Card"

    {

       layout

       {

           modify("Unit Price")

           {

               Visible = isSuperUser;

           }

           modify("Unit Cost")

           {

               Visible = isSuperUser;

           }

           modify("Vendor No.")

           {

               Visible = isSuperUser;

           }

         // You Can add more fields with same structure

       }

       var

          isSuperUser : boolean;

       trigger OnOpenPage();

       var

          AccessControlRec :  Record "Access Control";

       begin

          isSuperUser := true;

          AccessControlRec.reset();

          AccessControlRec.setfilter("User Security ID",USERSECURITYID);

          AccessControlRec.setfilter("Role ID",'SUPER');

          If not AccessControlRec.findset() then

            isSuperUser := false;

       end;

    Thanks in Advance for your help.

    Regards,

  • Suggested answer
    I Gusti Made Ari Profile Picture
    3,608 on at

    You can use PageCustomization and assign it to the profile , then assign the profile to the user which you do not want to see.

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-page-customization-object

    profile TheBoss
    {
        Description = 'The Boss';
        RoleCenter = "Business Manager Role Center";
        Customizations = MyCustomization;
        Caption = 'Boss';
    }
    
    pagecustomization MyCustomization customizes "Customer List"
    {
        actions
        {
            moveafter(Orders; "Blanket Orders")
    
            modify(NewSalesBlanketOrder)
            {
                Visible = false;
            }
    
        }
    }

  • MadMax33 Profile Picture
    18 on at

    Hi how dont allow user to do personalize

    if we hide this field from extension

    Thanks

  • Rupali  Profile Picture
    335 on at

    Thanks alot,

    How to  assign the profile to the user who I do not want to be able to  see.

    I could create the customised page and profile but struggling with assigning the profile to user.

    Thanks alot in Advance.

  • Netjacker2097 Profile Picture
    286 on at

    great thanks

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,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 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