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

Setting Editability or Visibility of a field from a codeunit

(0) ShareShare
ReportReport
Posted on by 1,037

Hi All,

Is there a way to set the editability or visibility of a page field from the OnOpenPageEvent trigger from a codeUnit.

 [EventSubscriber(ObjectType::Page, Page::"Job Card", 'OnOpenPageEvent', '', true, true)]
    Procedure JobCrdOnOpenPage(var Rec: Record "Field Security Header")
begin
//setVisibility();--code here for each field
//SetEditability();--code here for each field
end;

Regards,

Indira

  • Suggested answer
    Akshay_Panchal Profile Picture
    402 on at

    Hii,

    You cannot modify properties using event subscriber for that you have to create page extension. Through page extension you can set or modify properties.

    Thanks

    Please verify if this answer help to you .

  • Suggested answer
    JAngle Profile Picture
    161 on at

    You would need to manage the page variable via a page extension. No problem having the overall visibility set by a codeunit for repeatability. You would have to call it in the pages OnAfterGetRecord instead. The variables result can then be taken from a custom codeunit.

  • Indira88 Profile Picture
    1,037 on at

    I understand .Thank you .

    This was so that I could implement field level security.

    or else to implement that I have to go about extending every page. If  you have any solutions do share.

    Appreciate all the help!

    Indira

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 664 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 446 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 282 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans