Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Making field read only for non admin users.

shubhamverm3478
Tera Contributor

Hi,

I want to make two fields read only for some non admin users on workspace form .

How can I achieve this with UI Policy.

6 REPLIES 6

Is there a way we can add those users sys id rather than role for UI policy script?

@shubhamverm3478 

 

Make use of below code in that case :

var userSysIDs = ['71826bf03710200044e0bfc8bcbe5d3b', '62826bf03710200044e0bfc8bcbe5df1', 'a8f98bb0eb32010045e1a5115206fe3a']; // Declare an array to store your non-admin user sys_id
var loggedinUserID = gs.getUserID(); //get current logged in user sys_id
if (userSysIDs.indexOf(loggedinUserID) != '-1') //Check if logged in user is part of the non-admin users array or not
{
    gs.print('exists'); // Modify here to perform tasks
} else {
    gs.print('not exists'); // Modify here to perform tasks
}
Thanks and Regards
Amit Verma