Unhandled exception in GlideAjax, Record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2024 09:10 AM
Hello folks!
I am working on an Legal service delivery project where we have a Record producer, where the first option is "Create new / Update existing". When "Update" is selected, a reference type field is displayed, where you can choose the user's requests that already exist.
The problem is that when I select any of the existing ones, I get this error message "There is a JavaScript error in your browser console"
When inspecting the form, in the console I find this:
Here is the Client Script code:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var COI_CREATE_NEW = 'new';
var COI_UPDATE = 'update';
var NONE = '';
g_form.setReadOnly('create_or_update_coi', true);
switch (newValue) {
case COI_CREATE_NEW:
g_form.setVisible('conflict_type', true);
g_form.setMandatory('conflict_type', true);
g_form.setMandatory('coi_record', false);
g_form.setVisible('coi_record', false);
break;
case COI_UPDATE:
g_form.setVisible('coi_record', true);
g_form.setMandatory('coi_record', true);
g_form.setMandatory('conflict_type', false);
g_form.setVisible('conflict_type', false);
break;
case NONE:
g_form.setMandatory('conflict_type', false);
g_form.setVisible('conflict_type', false);
g_form.setMandatory('coi_record', false);
g_form.setVisible('coi_record', false);
break;
}
}
Any help is welcome, thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2024 09:23 AM
HI @Aram Sosa ,
I trust you are doing great.
Please find the updated code as given below :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var COI_CREATE_NEW = 'new';
var COI_UPDATE = 'update';
var NONE = '';
switch (newValue) {
case COI_CREATE_NEW:
g_form.setReadOnly('create_or_update_coi', true);
g_form.setVisible('conflict_type', true);
g_form.setMandatory('conflict_type', true);
g_form.setMandatory('coi_record', false);
g_form.setVisible('coi_record', false);
break;
case COI_UPDATE:
g_form.setReadOnly('create_or_update_coi', true);
g_form.setVisible('conflict_type', false);
g_form.setMandatory('conflict_type', false);
g_form.setMandatory('coi_record', true);
g_form.setVisible('coi_record', true);
break;
case NONE:
g_form.setReadOnly('create_or_update_coi', false);
g_form.setMandatory('conflict_type', false);
g_form.setVisible('conflict_type', false);
g_form.setMandatory('coi_record', false);
g_form.setVisible('coi_record', false);
break;
}
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2024 10:29 AM
The error message keeps appearing...
If I can provide you with more information to solve this, I will be happy to do so.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2024 10:45 AM
Hi @Aram Sosa,
It appears that the Catalog client scripts are different from the shared scripts. This is with out GlideAjax call.
Thanks,
Sagar Pagar