web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Displaying and hiding fast tabs according to user permissions

(0) ShareShare
ReportReport
Posted on by 305

Hi

I have an extension where in the "Resource" card page, I want to hide Invoicing section (fastTab) from a specific user and show it to other user. Is there a way to accomplish this? Please help.

Thanks in advance!

Khudeja

I have the same question (0)
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    You can assign a variable to the Visible property on the field and then set the variable on the OnOpen trigger.

  • khudeja Profile Picture
    305 on at

    Hi Teddy,

    Thanks for responding. Can you also help me with the code in OnOpenPage trigger to identify which user is logged in the tenant currently?

    Regards

    Khudeja Husain

  • Genie Cetas Profile Picture
    472 on at

    Hi,

    Follow the below steps:

    1) Create a new boolean field in the user setup.

    2) Create a new boolean variable such as showtab and new record variable for the user setup.

    3) Write the below code on open page trigger.

         UserSetup.GET;

         IF UserSetup.GET(USERID) AND UserSetup.(New Boolean Field) THEN

            Showtab := TRUE

         ELSE

            Showtab := False;

    4) Assign the Showtab boolean variable to page group visible property.

    Voila!

  • Suggested answer
    Olister Rumao Profile Picture
    3,967 on at

    Hey,

    You can either use USERID function to or find the User by using USERSECURITYID and filtering Users Table by USERSECURITYID.

    Let me know if you need help.

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    User USERID to get the current user. If you want to build the setup for each user, I recommend using the table called User Setup.

  • khudeja Profile Picture
    305 on at

    Hi

    I used this code for getting user id and I also entered the user in user setup table. But when I open the resource card, it throws the following error:

    The User Setup does not exist. Identification fields and values: User ID=''

    How should I handle this? Please help.

    Regards

    Khudeja

  • Suggested answer
    Olister Rumao Profile Picture
    3,967 on at

    Hi Khudeja,

    You can try this,

    1. Create a field in User Setup let's say a boolean FastTabVisible.

    2. Create a boolean variable pageFastTabVisible which will be set on the Visible property for the FastTab

    3. When the page opens set the boolean true or false depending upon a the user id and user setup

    Code will be on OnOpenPage trigger

    User.Get(USERSECURITYID);

    UserSetup.Get(User);

    If UserSetup.FastTabVisible = True then

    pageFastTabVisible :=True

    Else

    pageFastTabVisible := False;

    I hope this resolves your issue.

    Let me know if you need help.

  • Suggested answer
    Olister Rumao Profile Picture
    3,967 on at

    Hi Teddy,

    Just for you information, I had faced this issue in Business Central Cloud where USERID returned MSOLSYNC as the user name which was actually not present in Users.

    So I found that USERSECURITYID is the best field to use with Business Central and is the primary key of Users Table.

  • khudeja Profile Picture
    305 on at

    Hi Olister,

    I tried the code you suggested but it is throwing the following message on opening the resource card:

    The length of the string is 161, but it must be less than or equal to 50 characters. Value: {<id>}

    How to work this out?

    Regards

    Khudeja

  • Suggested answer
    Olister Rumao Profile Picture
    3,967 on at

    Khudeja,

    Please send the code so I can check.

    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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans