- 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 01:40 PM
Thanks Prateek. Unfortunately, it did not work. Same thing. Only executes on load, not on change. Here's what i'm doing:
javascript:new FSIWorkOrderClientUtils().test1(current.state);
current.state is the state field from a custom table extended from task. It has values like "Resolved", "Pending", "New". I am not doing anything with the parameter on the server, only gs.info.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 01:44 PM
The form isn't saved to the DB so we might not have access to current object. Try and see if you can get it working using below:
new SI().test1(g_form.getValue('state'));
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 02:06 PM
Same issue. Does not execute on change, only on load. Have you tested this? Is this executing on change for you? Because my coworker is also testing this in a separate instance and has the same result. It only executes on load, not on change. Thanks
- 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-20-2023 11:43 AM
Hi Prateek. Sorry for the delay. I took a few days off. Just wanted to let you know that the issue is apparently that we did not have anything in the "Dependent Field" tab of our Dictionary. By filling in a Dependent Field, SN knows to run the reference qualifier whenever the dependent field changes. Without a Dependent Field, it only runs on load, which is what was happening to us. Thanks for your help and thanks to my coworker for finding the issue.