To make fields read only based on assignment group

moulik1
Kilo Guru

Hello All,

In our scenario we have created a list of tasks and all the tasks are assigned to some assignment groups.

If the user is from ABC group and when he tries to open a task (which is assigned to another group) from a list of tasks in requested item then all the fields of that task should be read only and an alert message has to be shown that you don't have access to this task.

how can we achieve the above scenario?

Thanks.

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Moulik,



ACL's is the best way to achieve this. You can restrict the write access to the table. Here is the script section you can use.


answer= checkIfMember();


function checkIfMember()


{


  var current_user= gs.getUser();


  return current_user.isMemberOf(current.assignment_group.name);


}






View solution in original post

12 REPLIES 12

Yes u r rgt Pradeep Sharma.But here he wants to show an alert.


That can still be achieved through the BR just for message purpose.


If you use an ACL and the user doesn't have write permissions, doesn't that make the field no longer mandatory?


That's what I found when i tried the ACL approach. Sure the field was gray and the user couldn't pick an assignee but then the field was no longer mandatory for them and they can just close the ticket without any assignee.