- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2017 12:28 PM
All,
I have done a lot of search on the community and have not found an answer to what I'm looking for. There are many similar questions, but not what I'm looking for:
Scenario:
I have two reference fields StockRoom & Assets that are defined as catalog client variables task which is part of a workflow.
When someone picks the stockroom I want only the assets that are in that stockroom to show up in the assets reference field and then allowing them to pick that asset
When the stockroom changes I want the asset list also to change
So this is similar to many posts that I saw for advanced reference qualifiers, but I dont think advanced reference qualifiers work for an "onChange" correct?
I also saw a lot of mention about catalog "onChange" client script, but all those were referring to populating the second reference field with a specific value, I would like the functionality to see all the assets when the stockroom value changes, allowing the user to pick the asset for that stockroom
Has anyone done something similar?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2017 02:13 PM
Rather than returning the string of sys_ids, why not return the filter like this:
return 'install_status=6^stockroom='+selected_stockroom+'^substatus=Available'; (You can always double check the filter language by going to the asset table, filter it how you want for a particular stockroom, status, substatus, then right click and choose copy query. You can paste that into your script include and then just replace the sys_id of the stockroom with your selected_stockroom).
Also, double check that the script include is client callable (checkbox on the form).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2024 02:19 PM
I had the same requirement, a simple working solution to curate the Assets reference field to only search assets belonging to the stockroom selected in Stockroom reference field is by writing the following script in the reference qualifier of the asset variable.
javascript:"stockroom="+current.variables.stockroom
