- 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 02:54 PM
I have tired your suggestion code and it works in side of the application. However, I tried on the portal and that did not work. I might have screwed up somewhere in the code. Thank you for continuing to help.

- 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-06-2024 03:36 PM
Hello @Harsh Vardhan
You have done it again! It works perfectly.
I have seen many of your resolved threads, and you are truly an outstanding programmer.
I wanted to thank you for the time and effort you have dedicated to the community. You have really made a difference. I sincerely thank you again.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 10:39 AM
Glad my answer helped you.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 03:59 PM
This solution worked great in the classic catalog ui, but would not work in portal for me.
The following was the only solution i found that worked in both UIs:
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
g_form.removeOption('part_id', '');
g_form.addOption('part_id', '', '');
g_form.clearValue('part_id');
}
}