- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 11:18 AM
Hi. I am attempting to create an advanced reference qualifier that runs when another field changes (before saving) but have been unsuccessful, as it only seems to run onload, not onchange. For example (only an example, what I'm trying to do is more complex), let's say I have two reference fields: states of the country (i.e. Alaska, Arkansas, etc.) and counties of the state. When the user changes the state, the reference qualifier should run and show only the counties in the state I have chosen. But the reference qualifier only seems to run after a save (onload). As mentioned earlier, what I'm trying to do is far more complex than this example and I need to run javascript on the server each time a field is changed. The main issue is how do I get a reference qualifier to run onchange before a save. Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 02:15 PM
Yes it works for me
Ref qualifier: javascript:new FillServers().pickServers(current)
SI: Client callable checked
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 11:41 AM - edited 06-15-2023 11:44 AM
Hello Michael,
Could you try following reference qualifier in counties,
javascript:'field_name_of_state_in_counties='+current.variables.variable_name_for_states.getDisplayValue();
Best regards,
Pethum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 11:56 AM
Hello Pethum. As I indicated, I need to run some server code each time the state field changes, and it is currently only happening onload. I need it to run onchange before the save/reload. So this solution will not work. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 11:49 AM
Wouldn't an onChange client script in combination with GlideAjax do the job?
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 12:11 PM
Hi Prateek. I tried this with the server side returning the json of the contents (value pairs) for the dropdown. But when I then tried using g_form.addOption with this result, it would not work because you can't do addOption for reference fields. Thanks.