Filter on Related List

Alex Kraemer
Giga Guru

Hello

 

I have created a Related List which shows all incidents with the same caller in the Incident Table. The list also works properly. Is it possible to set a filter so that the active Incident in which you are working is not displayed in the Related List?

 

The reason for this is that the Related List should only be displayed if there are Incidents from the same caller, which does not work because there is always an Incident from this caller.

 

Thanks for input and greetings
Alex

1 ACCEPTED SOLUTION

Ahmmed Ali
Mega Sage

Hello @Alex Kraemer 

 

I am assuming you are using OOTB "Incidents by Same Caller" relationship to show the incidents from same caller. If yes, then you can simply update query of the relationship to not include current incident being viewed. steps to do that:

1. Open relationships table and search with name and open the record which both queries and applies to incident table

AhmmedAli_0-1690199920550.png

 

2. Update the script with additional query as current.addEncodedQuery('sys_id!=' + parent.sys_id);

AhmmedAli_1-1690199987294.png

 

3. If not already done, open any incident, in related list of incidents by same caller, right lick and select configure > list control

AhmmedAli_2-1690200084855.png

 

4. Then in list control form, select "Omit if empty" and save

AhmmedAli_3-1690200176962.png

 

If you are not using OOTB, then create new relationship as shown above and add to your incident form.

 

Thank you,

Ali

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Hi @Alex Kraemer ,

  1. Navigate to the related list (example, Incidents on a problem record).
  2. Create the desired filter using the condition builder (example, [Active] [is] [true]).
    SandeepDutta_0-1690199885579.png

    3. Click Set as Default Filter.

Alex Kraemer
Giga Guru

Thanks for your reply.
I know this option but now i need the filter to filter out the active record above. Any idea?

Ahmmed Ali
Mega Sage

Hello @Alex Kraemer 

 

I am assuming you are using OOTB "Incidents by Same Caller" relationship to show the incidents from same caller. If yes, then you can simply update query of the relationship to not include current incident being viewed. steps to do that:

1. Open relationships table and search with name and open the record which both queries and applies to incident table

AhmmedAli_0-1690199920550.png

 

2. Update the script with additional query as current.addEncodedQuery('sys_id!=' + parent.sys_id);

AhmmedAli_1-1690199987294.png

 

3. If not already done, open any incident, in related list of incidents by same caller, right lick and select configure > list control

AhmmedAli_2-1690200084855.png

 

4. Then in list control form, select "Omit if empty" and save

AhmmedAli_3-1690200176962.png

 

If you are not using OOTB, then create new relationship as shown above and add to your incident form.

 

Thank you,

Ali

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Alex Kraemer
Giga Guru

Hi Ali

The query you gave me was exactely what i was looking for.

Thanks a log

Regards

Alex