How to add a default filter in a related list

Divya choudhary
Giga Expert

Hi,

In the user table related list "Skills", i want to show only L1 skills by default and add another related list where i want to show L2 skills. "Skills" related list in user table is referring to user_skill table where skill is a field which is referring to skill table. In skill table we have level as L1 and L2. How can i add default filters in the user table?

Divyachoudhary_0-1666168580973.png

 

1 ACCEPTED SOLUTION

AnirudhKumar
Mega Sage
Mega Sage

You will have to create a custom Relationship.

Navigate to System Definition -> Relationships -> New

 

Name : L1 Skills

Applies to table : sys_user

Queries from table : sys_user_has_skill

Query with (Script):

current.addQuery('user', parent.sys_id);
current.addQuery('skill.level_type.name', 'L1');

 

The on your user record , you will go to Configure -> Related List and add 'L1 Skills'

View solution in original post

6 REPLIES 6

Sai Kumar B
Mega Sage
Mega Sage

@Divya choudhary 

  1. Navigate to the related list 
  2. Create any desired filter using the condition builder (example, [Active] [is] [true]).
     
  3. Click Set as Default Filter.

SaiKumarB_1-1666172575510.png

 

AnirudhKumar
Mega Sage
Mega Sage

You will have to create a custom Relationship.

Navigate to System Definition -> Relationships -> New

 

Name : L1 Skills

Applies to table : sys_user

Queries from table : sys_user_has_skill

Query with (Script):

current.addQuery('user', parent.sys_id);
current.addQuery('skill.level_type.name', 'L1');

 

The on your user record , you will go to Configure -> Related List and add 'L1 Skills'

Hi Anirudh,

Thanks, and it worked. Can you also tell how to set the list view of both the related list? So, if in Skill L1 related list which i have named as Skills, i only want to show fields related to skills and in Skill L2 related list which i have named as certifications, i want to show fields related to certifications like certification type, details etc.

Hmm... For this, you will to work on both the related list separately.

Right-click (on the related list column)-> Configure -> List Layout.

You should see the Skill field in the Available bucket. Hopefully it should show a + icon.

Click it and you should be able to access the fields on the Skill table... 

 

Bring whatever Skill fields you need to the right bucket.

 

I'm not sure about certifications, try the same method I guess.