Dynamic reference qualifier not updating PO list on Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi Community,
I’m working on a Catalog Item in where I need to dynamically refresh a reference field (Purchase Order) that points to a custom table u_ast_purchase_order.
The Purchase Order list must refresh whenever the Master Agreement reference field changes - without reloading the form.
FYI: refresh_purchase_order_toggle - Toggle variable
Below is the reference qualifier I am currently using on the Purchase Order variable:
javascript:(function() {
if (current.variables.refresh_purchase_order_toggle) {
var list = new x_hpmms_change_man.MoveNonContractualAssetstoContractualCatalog() .getPurchaseOrdersForMasterAgreement(current.variables.master_agreement + "");
return 'sys_idIN' + list;
}
return '';
})();
My issue
In Service Portal, the reference field does not refresh properly when Master Agreement changes. I don’t want to reload the form — just refresh the available PO list based on the Script Include logic.
Looking for guidance on:
Correct approach to refresh reference fields dynamically without refreshing/reloading the catalog item form
Whether my toggle logic + reference qualifier structure is correct
Any best practices to make reference qualifiers react to other reference variable changes
Scenario -
- User opens the Catalog Item form.
- User selects a Master Agreement (reference field).
- Purchase Order (reference field) should filter based on the selected Master Agreement.
- If no matching PO exists, the user sees a Rich Text message with a hyperlink to Create Purchase Order (another Record Producer).
- User clicks the link, fills out the Create PO form, and submits.
- User returns to the original Catalog Item form.
- Expected Behavior: The newly created Purchase Order should now appear in the PO reference list without reloading the form.
- Actual Behavior: Newly created Purchase order not appear in Purchase Order field without reloading field.
Thanks for any help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
what type of variable is this -> refresh_purchase_order_toggle
If something gets changed in that then only the other variable will be filtered
try this once
javascript: var query;
if (current.variables.refresh_purchase_order_toggle) {
var list = new x_hpmms_change_man.MoveNonContractualAssetstoContractualCatalog() .getPurchaseOrdersForMasterAgreement(current.variables.master_agreement + "");
query = 'sys_idIN' + list;
}
query = '';
query;
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
