gs.getUserID() need basic understanding.

naresh1019
Mega Expert

Hello Guys .....Can you please guide with the following requirement.

1) I have a form with with only two date fields.

2) I want to create ACL to update the entries depending on the users who creaetd it .

3) find_real_file.png

The following sript condition is not working.

4) please guide me ,

1 ACCEPTED SOLUTION

tvani
Tera Contributor

Hi Naresh,



You can use the below script as sys_created_by stores the user_name of the user.



if(current.sys_created_by.equals(gs.getUserName())


return true;


View solution in original post

21 REPLIES 21

PrashantLearnIT
Giga Sage

Hi Naresh,



You should use this:--



answer == (current.opened_by == gs.getUserID());


********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

preddy
Kilo Guru

Hi Naresh,


Create write Acl.



answer = gs.getUserID();



If this helpful hit correct


Hi Pavan,



Thats not correct, it will allow to all logged in user to update the fields.


********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

Not Woring,



By the way doubt, I guess the answer variable should be true/false ...