Pop up mandatory attachment message
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 11:42 AM
May I ask why you are not using a UI Policy for this? Give the UI policy a condition, IF these field values are present, then make the attachment icon mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 07:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 09:14 PM
Hi @Srinivasu2,
Can you try the below code.
function onSubmit() {
var test = g_form.getDisplayValue('data_master');
if((this.document.getElementsByClassName('get-attachment').length == 0) && (test == 'Customer and Operation' )) {
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 09:29 PM