- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 10:59 AM
On our demand table we have a routing precedence column with 5 different labels. The demand table and routing precedence labels are shared across many different catalog items /record producers.
There is a request for one particular record producer to only show two of the 5 different lables on the drop down menu. Below are the 5 choices. We only want Low and Urgent to appear.
Current choices but only want two of these to appear.
Just in case here are the labels in the dmn_demand table.
Issue is most options search the demand table's list view to return values. In our case we want to populate the demand table's routing precedence fields with the choice selected in the record producer.
I believe the best option is the Lookup Select Box but I cannot filter out 3 of the column labels to just show Low and Urgent on the submission form.
There are a lot of enteries on the Developer Forum such as filter to show choices from the sys_user table list view but I haven't had any luck in options for the Lookup label field(s) or Reference qualifiers. Not as easy as adding "Low,Urgent" or "u_Low,u_Urgent" in the label field.
Any suggestions would be appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 11:54 AM
@Scott93 You should add the client script in the Client Script related list of the Record Producer. The What is will contain script is a server side script and it will not be able to run the client side code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 10:48 PM
The actual simplest way to solve the problem would be to use a Select Box and enter in the 2 choices with the same values and labels as the ones from the Demand table.
Duplicates choices, yes, but the less code we use, the better: easier maintenance and less chance of problems.
What you are doing now is getting values from another table, adding them to the drop down list and then removing more options than what you are leaving behind. And anyone maintaining this after you has to be aware of the Client Script that removes the options (not an obvious thing, especially for a junior developer). You are just adding complexity for no good reason.
The first answer to solving a problem should NOT be adding more code.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 11:33 AM - edited 04-04-2024 11:34 AM
@Scott93 Instead of choosing the variable type as Look up select box, you should choose Select box and in the type specification of the Select box choose choice table as Demand [dmn_demand] and Choice field as Routing Precedence.
Now in order to remove just show Low and Urgent as options. You simply need to use an onLoad Client script and add
function onLoad() {
g_form.removeOption('routing_precendence','Routine');
g_form.removeOption('routing_precendence','Priority');
g_form.removeOption('routing_precendence','Urgent/Critical');
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 11:48 AM
Thank you Sandeep. My question is where do I add the onLoad Client script? I just tried it in the script section of the record producer's What it will contain tab.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 11:54 AM
@Scott93 You should add the client script in the Client Script related list of the Record Producer. The What is will contain script is a server side script and it will not be able to run the client side code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 12:29 PM
Sandeep thank you for continuing to work with me.
Please see screen shot below. Still receive all choices from the demand table.
I have tried different combinations such as:
- Type = OnLoad
- Isolate Script box checked or not checked.
- Different combos of Applies on Catalog & Target record boxes.