- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 11:08 AM
Hello,
I have the following two variables, reference and lookup select box. The variables are getting data from the same table: u_part_number
On the "lookup select box", I am using Auto-Populate to fill in the Part Id variable.
How to you clear Part Id variable on Part number changes.
Here is the onChange script I have tired, but it did not work. Please help. Thank you
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 12:50 PM
@Lisa Goldman Strange , but anyways you can give another try.
Set 'Include none' as true on your Lookup select box variable and now use below script.
eg:
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
g_form.removeOption('part_id','');
g_form.addOption('part_id', '', '');
}
}
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 07:25 AM - edited 02-03-2025 07:46 AM
Hello Lisa,
If you want to clear a value from onchange script, that use lookup select box type variable, add a condition with newValue == null:
if (newValue == ''|| newValue == null) {
g_form.clearValue('variable_name');
}