Mandatory attachment

Hafsa1
Mega Sage

We have a custom widget form used to create/update record in "sn_hr_core_employee_form" table.

I got attached widget which I want to modify for my instance. 

I want to make attachment mandatory such that before insert/update via widget/portal it should through error and atleast 1 attachmnet should be available to load.

 

2 REPLIES 2

Samaksh Wani
Giga Sage
Giga Sage

Hello @Hafsa1 

 

Use this script for mandatory attachments :-

 

 

var count = getSCAttachmentCount();
if(count <= 0) {
alert('You must attach the completed form before submitting this request.');
return false;

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Hafsa1
Mega Sage

I'm using custom widget