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 :
Business Central forum

Hiding a column in sub-form

(0) ShareShare
ReportReport
Posted on by

The task is as follows:

  • Develop an extension that hides a column in a line item if the currently logged in user is NOT A SUPER USER.
    • The screenshot below is from a Sales Invoice item.  I already know how to check whether the currently logged in user is a Super user.  

ss.PNG

Categories:
  • Verified answer
    Community Member Profile Picture
    on at

    Hi Kenny,

    Try this code :

    pageextension 50111 SalesInvoiceExt extends "Sales Invoice Subform"
    {
        layout
        {
            modify("Unit Cost (LCY)")
            {
                Visible = isSuperUser;
            }
        }
    
        var
           isSuperUser : boolean;
    
        trigger OnOpenPage();
        begin
           If not UserIsSuperUser() then   // UserIsSuperUser is a custom function. 
             isSuperUser := false; 
    
        end;
    }

    .

    Please verify my answer if you find my answer helpful. Doing so you'll show other community members that there was found a solution and you credit my help.

    .

  • Community Member Profile Picture
    on at

    Thanks Nissay...Your answer does the trick.  Although I realized that the fields can be brought back clicking on "Personalize" and going through the UI to get back the fields.  Is there any way to make the desired fields unavailable to be shown in the table by using extensions?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans