I want to show account related contacts based on account selection in Record producer.

Rajesh Sheela1
Tera Contributor

I want to show account related contacts based on account selection in Record producer. Can anyone help me how to achieve this?

4 REPLIES 4

Murthy Ch
Giga Sage

Hi @Rajesh Sheela1 

You can write a reference qualifier on account related contacts variable like below logic:

 

javascript:"accountFieldName="+current.variables.accountVariableName;
//replace with your variable and field names..

Replace : with :

 

Hope it helps..

Thanks,
Murthy

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Rajesh Sheela1 ,

You can try advance reference qualifier on contact variable as below:- Replace with proper variable and field names

GunjanKiratkar_0-1669194426341.png

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

Hi Gunjan,

 

I tried this and its working but when we click on dropdown value once again it is showing all accounts. but i want to show only those contact which are related to account.

Musab Rasheed
Tera Sage
Tera Sage

Hello,

If you are talking about CSM then you can see how it is setup for OOB record producer and then check field 'Contact'

https://instance/sc_cat_item_producer.do?sys_id=644ffeccc70500104c1bf9f91dc260d8&sysparm_record_targ...

 

Contact field : instance/item_option_new.do?sys_id=0743c740c74500104c1bf9f91dc26036&sysparm_record_target=item_option_new&sysparm_record_row=3&sysparm_record_rows=10&sysparm_record_list=cat_item%3D644ffeccc70500104c1bf9f91dc260d8%5EORDERBYorder

 

Reference qualifier :

javascript:var ret='account.customer=true'; if (!gs.nil(current.variables.account)) ret += '^account='  +  current.variables.account; ret;
Please hit like and mark my response as correct if that helps
Regards,
Musab