web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: How to hide a field in Business central through page extension

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

    {

     layout

     {

       modify("Unit Price")

       {

         Visible = false;

       }

     }

    }

  • Rupali  Profile Picture
    335 on at
    RE: How to hide a field in Business central through page extension

    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
    RE: How to hide a field in Business central through page extension

    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
    RE: How to hide a field in Business central through page extension

    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,594 on at
    RE: How to hide a field in Business central through page extension

    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
    RE: How to hide a field in Business central through page extension

    Hi how dont allow user to do personalize

    if we hide this field from extension

    Thanks

  • Rupali  Profile Picture
    335 on at
    RE: How to hide a field in Business central through page extension

    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
    RE: How to hide a field in Business central through page extension

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,750

#2
Sumit Singh Profile Picture

Sumit Singh 2,689

#3
YUN ZHU Profile Picture

YUN ZHU 1,987 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans