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...
Answered

How to make field to non editable field on condition?

(1) ShareShare
ReportReport
Posted on by 60
I have created 2 fields, I would like to make it non editable on user group condition.
 
when the user is in user group /PURCH/ then cannot edit Procurement note.
 
or when the user is in user group /SALES/ then can edit Procurement note.
 
Thanks in advance.

Here are the code below:
 
tableextension 80000 PurchHeadExt extends /Purchase Header/
{
    fields
    {
        // Add changes to table fields here
        field(80101; /Procurement Note/; Text[2048])
        {
            Caption = 'Procurement Note';
            DataClassification = CustomerContent;
        }
        field(80102; /Vendor Note/; text[2048])
        {
            Caption = 'Vendor Note';
            DataClassification = CustomerContent;
        }
    }
}
 
pageextension 80000 PurchOrderExt extends /Purchase Order/
{
 
    layout
    {
        addlast(General)
        {
            field(ProcurementNote; rec./Procurement Note/)
            {
                Caption = 'Procurement Note';
                ApplicationArea = suite;
                MultiLine = true;
                ShowCaption = true;
 
            }
 
            field(VendorNote; rec./Vendor Note/)
            {
                Caption = 'Vendor Note';
                ApplicationArea = suite;
                MultiLine = true;
                ShowCaption = true;
            }
 
        }
 
    }
 
}
I have the same question (0)
  • black_s Profile Picture
    328 on at
    Hi,
     
    A better design would be to add a boolean on the user setup and tick for those who can access.

    Use an on OpenPage trigger to get the Usersetup of the user currently logged in. The fetch the contents of that field and assign to a variable.

    Then assign the variable to the editable component field.

     
    The issue am finding with the user group route  is if a user is assigned to both user groups, the logic will fail



  • Suggested answer
    TL-04060938-0 Profile Picture
    60 on at
    could you please let me know the codes?
     
  • Verified answer
    YUN ZHU Profile Picture
    99,978 Super User 2026 Season 1 on at
    Hi, You can refer to the standard documentation below.
    PS: Deprecating InDataSet attribute used for global variables in Pages (The InDataset attribute is unused)
     
    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!

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

#2
YUN ZHU Profile Picture

YUN ZHU 965 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans