- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 01:01 PM - edited 01-03-2024 01:15 PM
Basically what the subject says, I need a way to see if a reference field is cleared (user just highlights and deletes the content). OnChange doesn't capture it even removing the newValue == '' default at the top of it. I'm guessing because it's technically not cleared and the value hasn't really changed. Is there a way around this? I'm aware I can do this in a Business Rule, but I really prefer not to.
Generic example of what I'm doing if needed:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
if(newValue == ''){
g_form.addErrorMessage('My Error Message');
g_form.setValue('ref_field', oldValue);
}
//Type appropriate comment here, and begin script below
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 02:04 PM - edited 01-04-2024 02:04 PM
I figured out the issue. I was having a brain fart I guess. Just needed to check the inherited checkbox as where the script was running was on a child table. (facepalm)
Thanks everyone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 02:04 PM - edited 01-04-2024 02:04 PM
I figured out the issue. I was having a brain fart I guess. Just needed to check the inherited checkbox as where the script was running was on a child table. (facepalm)
Thanks everyone.