Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:11 PM
Hi @Jackhol ,
Since its OnSubmit getXMLAnswer() wouldn't work here since its Async form will be submitted before response received from the script include
use getXMLWait() instead (FYI: this wouldn't work if use this in Service portal)
ga.getXMLWait();
answer = ga.getAnswer();
if(
**********
unction onSubmit() {
var assGroup = g_form.getValue('assignment_group');
if (assGroup == 'a60fe98cdb27d85006d43ce3399619d7') {
var ga = new GlideAjax('check_open_inc');
ga.addParam('sysparm_name', 'checkAttach');
ga.addParam('sysparm_ticket', g_form.getUniqueValue()); //Sending Ticket sys_id as parameter.
ga.getXMLWait();
answer = ga.getAnswer();
if (answer == 0) {
var conf = confirm("You have not added an Attachment to this ticket, click Cancel to add an attachment, click Ok to continue");
return conf;
}
}