Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Restrict related list records

Ram89
Kilo Contributor

Hi everyone,

I have to restrict CIs in the related list section of the incident form based on the caller, for example If I am the caller then I need to show CIs in the related list section which are just from my company.

Like if I am the caller and my company is TCS, then I should be able to see only TCS CIs when I try to add in the Affected CIs related list. Can somebody give me the script or way on how to achieve this.

Thanks,

Ramesh

6 REPLIES 6

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can add a default filter ont he related list to show only the CIs needed

 

You can add the default filter of a related list by right clicking on one of the column headers / field names in the related list > Configure > List Control in the List Control form if the Edit default filter field is not present right click on the form header > Configure > Form Layout and add the Edit default filter field as a selected field.

 

-Anurag

-Anurag

Ram89
Kilo Contributor

Thanks for the quick response Anurag,

But how do I add the filter condition here. We are storing company name of the CI in the account column in the cmdb_ci table, so I am not sure of the filter condition.

 

Thanks,

Ramesh

Ankur Bawiskar
Tera Patron
Tera Patron

@Ram89 

check this link on how you can modify the filter; approach shared by me; enhance it

Change the condition for Affected CIs and Impacted Services/CIs Related Lists

Regards
Ankur

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

Ram89
Kilo Contributor

Thanks @Ankur Bawiskar  for the response,

So is the script exactly the same for the incident form too or do I need to make any changes here? Please let me know if there are any modifications that needs to be made to the script.

Waiting on your response.

Regards,

Ram