How to fix the OnChange Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 12:56 AM
Hi All ,
I have written the below onchange client script for impact field ,
the requirement is .. whenever an Incident form is opened there is some default value for the impact field on the Incident form being setup .. so if the customer changes the default value of the Impact field before clicking on the SAVE button on the Incident during that time the worknotes should not be mandatory which is working perfectly fine with the below code .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 02:34 AM
Pls try below script and confirm if this fulfils your requirement.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
// If the value has changed and the record is not new
if (newValue != oldValue && !g_form.isNewRecord()) {
g_form.setMandatory('work_notes', true);
}
}