Change textbox color/style based on User's security group OR based on field security

Hoping someone can help me find the answer :crossed_fingers:

I’m trying to replicate a customization that we have in Classic UI, in the Kinetic UI. In Classic, on Part Maintenance, I have the background color of each text box color-coded to which department is responsible for maintaining that value, e.g. green = Eng, purple = Sales, pink = Purchasing, etc.

I know we have limited color/style options in Kinetic UI, so instead of color-coding all the text boxes I’d like to just highlight the fields that can be edited by the current user based on the current User’s security group OR based on field security.

I’ve added field security to the fields already, but can’t find a way to add a row rule in App Studio that says “if the user has full access to the field, highlight it” or “if the user is part of security group X, highlight field Y”.

For example, if the user is from Eng security group, highlight Part, Description, UOM Class, etc. (the fields they would have full access to).

Any ideas out there? :folded_hands:

1 Like

Perhaps you could run a BAQ or function when the page loads to get the fields that can be edited by the current user.
Set those fields in the TransView.
Add a data rule condition based on the TransView field.

3 Likes

Forgive the “Lord of the Rings” references in the below post… but if you add a UserFile dataview, you can gain access to the current user’s GroupList and compare that against Constant.CurrentUserID in a row rule.

5 Likes

I will definitely try this out! Thank you!!
lord of the rings hobbits GIF (GIF Image)

2 Likes

Ok, I’ve added the UserFile dataview, tied it to Constant.CurrentUserID, and according to the developer tools it looks like it’s loading data…but the row rule isn’t working. What am I missing here? :thinking:

I see, it isn’t actually loading the data. I added some pop-ups and it’s the ‘on error’ pop-up that appears :frowning:


Can you monitor the debugging? In the Network tab, you should see the GetByID rest call. Can you see if it is passing a UserID in the payload?

If so, what can you see in the Response?

I just set this up again as a test and it worked fine. If yours still isn’t working, let’s review the UserFile GetByID rest call settings.

Method Parameters:

There won’t be any Request Parameters…

Response Parameters:

All of those settings, with the exception of the Constant.CurrentUserID value, should have been set up for you if you used the DataView wizard to create the GetByID event.

BUT… one last potential gotcha… If, perhaps you were poking around and exploring, and you happened to click on the “Dataset” option in the Response Parameters, this will probably break your event!!!

If that’s the case… delete the rest-erp widget out of your event and rebuild it from scratch. Clicking into DataSet will blow things up!!!

3 Likes

Hurray! I must have just angered it the first time. I deleted and re-added the userfile data view and now it works. Thank you so, so much!!!
youtube win GIF by Hyper RPG

3 Likes