Some time attachment is not getting attached in the attachment variable in service catalog

Ankush Jangle
Tera Contributor

Hello All ,

 

I am using attachment variable in the service catalog ,For that we made the attachment field mandatory on the condition via UI policy and also wrote the on submit client script to make the variable mandatory but still some time attachment is not getting attachment any reason behind this please help me on this.

 

And when the attachment is not getting attachment at that time the variable is not visible on RITM and task

 

Thanks in Advance . .

5 REPLIES 5

Ravi9
ServiceNow Employee
ServiceNow Employee
Think some screenshot or code snippet will help getting answer.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

are you making it mandatory based on some condition?

is the issue coming with admins or non-admins?

Please share script, form screenshot etc

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi ,

Issue is coming with non-admin user

we had used UI policy to make the attachment variable mandatory but still in some case the attachment is not getting attached in the RITM.

So we wrote the Onsubmit Client script to make the attachment variable mandatory

Still No luck in some RITM attachment is not attached.

When we checked code is working fine but don't know for some user we are facing these issue

function onSubmit() {

var req_type = g_form.getValue("iserve_avon_details_type_of_request");


if (req_type == "extension") {

var attach_id = g_form.getValue("iserve_avon_reason_attachment");

if (attach_id == "") {
alert("Please add Attachment");
return false;

}
}

}

 

You can see check the attachment variable in the attachment

Thanks

Ravi9
ServiceNow Employee
ServiceNow Employee

you will need to debug this properly , put alerts in CS and try to simulate the behaviour , see if you can identify when exactly it fails , which line of code . its hard suggesting anything without accessing the environment