- 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
03-05-2024 12:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 01:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 01:19 PM
No, I meant the Part id field on the part number [u_part_number] table. The one you are referencing to fetch the data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 01:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 01:36 PM
Thanks, since the field is a 'String' type, you should also use a string type variable. Once you change the variable type, you can deactivate the Client Script.
Just a tip, make sure these data types are aligned, otherwise you will see unexpected behaviors.
Cheers