Restricting records visible in reports.

rkreddy
Giga Expert

Hi All,

Hope everyone is staying safe.

I got requirements like,

1. For a custom table say XYZ, users named A,B,C create some records. Now when A log in to his instance ( or when i impersonate to user A) he needs to see records that are opened only by him and even breadcrumb shouldn't be visible to him, because if breadcrumb is visible he can edit that and can able to see all the records. So in order to restrict him from seeing all the records, what can we do to restrict him to see only records opened by him.

2. And the second thing is the report level access, while creating reports also he should not able to see all the records, he needs to have only records created by him.

Your valuable answers help me a lot.

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Rakesh,

 

For the filter/breadcrumb you can use fixed query. Refer link for a check. In addition to this you need a Query Business rule that runs on the Custom table that again restricts the visibility.

Since, Query business rule will run on Table it will take care of reporting as well.

View solution in original post

6 REPLIES 6

Jaspal Singh
Mega Patron
Mega Patron

Hi Rakesh,

 

For the filter/breadcrumb you can use fixed query. Refer link for a check. In addition to this you need a Query Business rule that runs on the Custom table that again restricts the visibility.

Since, Query business rule will run on Table it will take care of reporting as well.

Hi Jaspal,

 

Thanks a lot for the answer.

 

Regards,

Rakesh Gudisa

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Rakesh,

please refer below response

1) For restricting to show only those records opened by logged in user; you can use query BR on that table

Even if they change some filter they cannot view other's record. Query BR will take care of restricting

Sample Script

function onBefore(current, previous) {
   //This function will be automatically called when this rule is processed.
  
	current.addQuery('opened_by', gs.getUserID());
	
}

2) for report level; the above Query BR will take care restricting at report level also

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Thanks alot for the response. Can you brief that, how can we use BR at report level.

 

Regards,

Rakesh Gudisa