- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks 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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
refresh_purchase_order_toggle is a reference field and currently holds the same value as master_agreement. I also expected that when the dependent reference field (refresh_purchase_order_toggle) changes, the purchase_order reference field would automatically re‑evaluate its reference qualifier.
However, in reality the Purchase Order choice list is not refreshing. The newly created PO does not show up in the dropdown list.
Interestingly, if the user manually searches for the PO number in the reference field, it does appear, which means the data exists - the list just isn't refreshing.
We need the new PO to appear directly in the list view because most users will not think of manually searching for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
