ORDERBY not working with JavaScript Reference Qualifier in Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2025 06:12 AM
Description:
I have a Record Producer with two fields — Services and Solutions.
Both Services and Solutions are Lookup Select Box variables.
The Solutions field is dependent on the Services field, and I’ve mapped this dependency through a custom field called u_dependent_field on the referenced table.
Scenario 1: When I use a static reference qualifier (without JavaScript), for example:
u_active=true^ORDERBYu_orderthe results are displayed correctly and sorted as per the u_order field.
Scenario 2: When I use a JavaScript reference qualifier, for example:
javascript:'u_dependent_field=' + current.variables.u_services + '^ORDERBYu_order';the dependent values are retrieved correctly based on the selected service, but the results are not sorted by u_order — instead, they appear in alphabetical order.
Could you please confirm whether ORDERBY is supported in JavaScript-based reference qualifiers for Lookup Select Box variables in Record Producers, or suggest the recommended way to ensure sorting by a specific field (like u_order) when using a dynamic qualifier?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2025 07:07 AM
This is working for me. In a more out of box example I have 2 Lookup Select Box variables on an incident record producer for Category and Subcategory. This is what Subcategory looks like:
The choices are ordered by the Sequence on the sys_chocie table. If I take out the orderby, they are sorted alphabetically. Make sure you have the Variable attribute pointing back to the name of the dependent variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2025 02:31 AM
Hi @Brad Bowman, I tried this as well, but it's not working. Is it possible to achieve this by calling a script include? I attempted to call it, but in what format should I return it since my field is a lookup select box?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2025 03:25 AM
Ensure the reference qualifier you are attempting is exactly correct. Specifically, is your Lookup Select Box type variable really named u_services? If so, this is a confusing choice as custom field names on tables are prefixed with u_, so choosing to name a variable u_anything is not the best approach. If you still have a doubt, please share screenshots of both variable definitions on the Question and Type Specification tabs, and a sample of the referenced table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2025 03:50 AM
Sure @Brad Bowman , Here are the variable definitions and their type specifications of two fields.
1a. Impacted services variable - question
1b. Type specifications
2a. Impacted Solution variable- question
2b. Type specification
