Pop up mandatory attachment message
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 09:04 AM
Hi Community,
Pop up a mandatory attachment message on service portal based on condition, like select a Data master is customer and Operation is New.
Attachments code is not working for me, Please let me where i did a mistake?
Please find the below attachments code
Regards,
Srinivasu Sagiraju
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 09:37 PM
Hi @Srinivasu2,
You can add a AND condition like below.
function onSubmit() {
var test = g_form.getDisplayValue('data_master'); // Try with getValue if this doesn't work
var test1 = g_form.getDisplayValue('operation'); // Try with getValue if this doesn't work
if((this.document.getElementsByClassName('get-attachment').length == 0) && (test == 'Customer' ) &&( test1 == 'New' )) {
alert('You must add an attachment before submitting this request.');
return false;
}
else{
return true;
}
}
Please mark this answer as correct and helpful if it solves your issue.
Regards,
Siva Jyothi M.