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

Page Customization for Profiles.

(1) ShareShare
ReportReport
Posted on by 44
Hello,
 
MY object:
To Hide the' Document Sending Profile' field on the Customer Card (Page 21) only for users with the profile ID 'Inventory Manager'.
 
I am using the Following Code in VS code. The code is showing no errors but its not effective. when i logged in as an 'Inventory Manager' i still can see that field.
Can someone kindly help me out on this.
 
I am using the following code:
pageextension 50100 HideDSPField extends "Customer Card"
{
    layout
    {
        modify("Document Sending Profile")
        {
            Visible = ShowField;
        }
    }
 
    var
        ShowField: Boolean;
 
    trigger OnOpenPage()
    var
        UserPersonalization: Record "User Personalization";
    begin
        // Default to visible
        ShowField := true;
 
        // Check current user's profile
        if UserPersonalization.Get(UserId) then
            if UserPersonalization."Profile ID" = 'Inventory Manager' then
                ShowField := false; // Hide for Inventory Manager
    end;
}
I have the same question (0)
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,169 Super User 2026 Season 1 on at
    You should use the OnAfterGetCurrRecord() trigger instead, which does run before layout evaluation:
     
    pageextension 50100 HideDSPField extends "Customer Card"
    {
        layout
        {
            modify("Document Sending Profile")
            {
                Visible = ShowField;
            }
        }
    
        trigger OnAfterGetCurrRecord()
        var
            UserPersonalization: Record "User Personalization";
        begin
            ShowField := true; // default to visible
    
            if UserPersonalization.Get(UserId) then
                if UserPersonalization."Profile ID" = 'Inventory Manager' then
                    ShowField := false; // hide for Inventory Manager
        end;
    
        var
            ShowField: Boolean;
    }
    
     
     
    Mark this as the verified answer if it helps.
  • Suggested answer
    RockwithNav Profile Picture
    8,967 Super User 2026 Season 1 on at
    I don't have a Sandbox running to publish it but please see if this is working 
     
     
    //RWN
    pageextension 50100 HideDocumentSending extends "Customer Card"
    {
        layout
        {
            modify("Document Sending Profile")
            {
                Visible = not IsInventoryProfile;
            }
        }
        var
            IsInventoryProfile: Boolean;
     
        trigger OnOpenPage()
        var
            SessionSettings: SessionSettings;
            GetProfile: Text;
        begin
            SessionSettings.Init();
            GetProfile := SessionSettings.ProfileId();
            IsInventoryProfile := (UpperCase(GetProfile) = 'YOUR PROFILE ID ');// It's hard coded make sure it's exact
        end;
    }
    //RWN
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,132 Super User 2026 Season 1 on at

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,949 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,064 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 559 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans