The CreatorCon Call for Content is officially open! Get started here.

End user should see the tasks which are assigned only to him

knowledgelearne
Kilo Contributor

Hello Community members,

I have a form which is used to create tasks and assign them to the particular user. Now as an end user, i should see the tasks which are assigned only to me. How can i perform that?

Thanks

1 ACCEPTED SOLUTION

ghsrikanth
Tera Guru

There are two ways you can do this - one is by Query Business rule route and another ACL route   -


In query BR -


1. Write a query BR for the incident, in the script current.addQuery('assigned_to',gs.getUserID());



Screen Shot 2016-03-17 at 9.23.09 AM.png



Screen Shot 2016-03-17 at 9.24.56 AM.png



The second option is ACL route -



Screen Shot 2016-03-17 at 9.22.09 AM.png



- Pros of using Query BR, when you have view the incidents in the list view, it looks clean but in case of ACL route, in the list view, there will be error message like "Security constraint preventing 40 records" and in the pagination it will display all the records.


This kind of misleads the end user.



- Pros of using Security ACL, when you do GlideRecord query in the script, ACLs are bypassed but Query BRs are not



Implement both and see whatever looks cleaner and better for you.



Mark if it is helpful or correct, feedback is appreciated


View solution in original post

9 REPLIES 9

Hi Komal,



Can you share the screenshot of the ACL you have created.


Also in case you wanna go before BR approach then you can start with the below article.


Controlling record access using 'Before Query' business rules - ServiceNow Guru


Yeah Pradeep, ACL has some problem with me Instead i shall follow with Before BR.


Thank you


Hi Komal,



If the issue is resolved, please mark the answer as correct, so that it will help the users in future in searching the community.



Thanks,


ghsrikanth
Tera Guru

There are two ways you can do this - one is by Query Business rule route and another ACL route   -


In query BR -


1. Write a query BR for the incident, in the script current.addQuery('assigned_to',gs.getUserID());



Screen Shot 2016-03-17 at 9.23.09 AM.png



Screen Shot 2016-03-17 at 9.24.56 AM.png



The second option is ACL route -



Screen Shot 2016-03-17 at 9.22.09 AM.png



- Pros of using Query BR, when you have view the incidents in the list view, it looks clean but in case of ACL route, in the list view, there will be error message like "Security constraint preventing 40 records" and in the pagination it will display all the records.


This kind of misleads the end user.



- Pros of using Security ACL, when you do GlideRecord query in the script, ACLs are bypassed but Query BRs are not



Implement both and see whatever looks cleaner and better for you.



Mark if it is helpful or correct, feedback is appreciated


Thank you so much Srikanth!!