Regarding onsumbit client script

Apoorva A H
Tera Contributor

 Code for  and what UI type should i need  to create an on-behalf leave I must add an attachment (any type of file is valid, encrypted or not encrypted). and  I try to create an on-behalf leave without an attachment I can't submit the request and the following message appears:

    1. "Uploading supporting document is mandatory"
11 REPLIES 11

can u provide the code for onsumbit catalog client script for the above story.

Samaksh Wani
Giga Sage

Hello @Apoorva A H 

 

var sysid = g_form.getUniqueValue();
 var attach = new GlideRecord('sys_attachment');
  attach.addQuery('table_sys_id',sysid);
  attach.query();
  if(attach.next()){
 alert("Uploading supporting document is mandatory");
  }

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

Apoorva A H
Tera Contributor

can u provide the code for onsumbit catalog client script for the above story.

 

Hello @Apoorva A H 

 

function onSubmit(){

var sysid = g_form.getUniqueValue();
 var attach = new GlideRecord('sys_attachment');
  attach.addQuery('table_sys_id',sysid);
  attach.query();
  if(attach.next()){
 alert("Uploading supporting document is mandatory");
  }

}

 

follow the above code for onsumbit catalog client script.

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

In catalog client script we cant able to use Gilde so asking to give other code.