Reference Qualifier based on Form View

Thenmozhi
Tera Contributor

Hi,

We have a requirement to apply reference qualifier for a reference field based on for form view. We have 2 views for location table say A & B. The reference qualifier specified on the Dictionary entry should be applicable only for view A and not on B.

Tried using 'gs.action.getGlideURI().getMap().get('sysparm_view')' to check the view. But this is always returning sys_ref_list which is the view of reference popup list.

Is there a way to get the view name of base form and apply reference qualifier accordingly.

Regards,

Thenmozhi

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

whenever you open reference field the URL always include the form view from where it got opened in this parameter -> sysparm_form_view

Below is the URL I got when I clicked the Assignment group field being on CHG Default view

https://instanceName.service-now.com/sys_user_group_list.do?sysparm_target=change_request.assignment_group&sysparm_target_value=&sysparm_reference_value=&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=assignment_group&sysparm_reference=sys_user_group&sysparm_view=sys_ref_list&sysparm_form_view=default&sysparm_additional_qual=&sysparm_domain_restore=false

When I changed to emergency view the URL included that as well

https://instanceName.service-now.com/sys_user_group_list.do?sysparm_target=change_request.assignment_group&sysparm_target_value=&sysparm_reference_value=&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=assignment_group&sysparm_reference=sys_user_group&sysparm_view=sys_ref_list&sysparm_form_view=emergencyChange&sysparm_additional_qual=&sysparm_domain_restore=false

Regards
Ankur

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

View solution in original post

7 REPLIES 7

Hi,

I checked in my PDI which is in Quebec

I believe it should work in paris as well

Regards
Ankur

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

I agree the parameter does not exist.  sysparm_view=sys_ref_list  does, but sysparm_form_view does not.

si21
Tera Guru

Hi @Thenmozhi , did you find the solution? How did you achieve this?