Attach a file in Catalog Item as attachment and alert while submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 02:30 AM
Hi All,
I want to attach one Excel Sheet as an attachment in one Catalog Item so that whenever form loads the attachment will be visible and any user can download it.
And once the user downloads the attachment will fill it up and again attach the same.
While clicking on Submit I want an alert to be popup if user forgets to attach the file in the Catalog Item.
Can anyone let me know how to achieve this?
Thanks,
SNOW@Das
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 05:01 AM
Hi,
Please kindly suggest me as I am getting bit confused.
I need to attach the file within one variable as a link to download it.
But when I tried that as HTML Type it is not working perfect as the Description field is also coming on the form.
Catalog Item View:
And I forgot to mention that the Script does work for me and my concern is will it also work for Service Portal as well?
So please kindly suggest me how can I achieve the same?
Thanks in Advance,
SNOW@Das

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 05:38 AM
That's why I suggest putting link under item description not into variable.
For service portal you might need to add another script:
function onSubmit() {
var isAttachmentMandatory = true;
if(isAttachmentMandatory)
{
var isOnServicePortal = parent.document.URL.indexOf('deus?id=sc_cat_item') != -1;
console.log('isOnServicePortal : ' + isOnServicePortal);
if(isOnServicePortal && parent.document.getElementsByClassName('file-list-wrap').length == 0)
{
getMessage('Alert Message', function(msg) {
g_form.addErrorMessage(msg);
});
return false;
}
return true;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 09:13 AM
Hi Slawek,
Actually the problem is there is already one link I have added in the Description and it is appearing at the top of the Catalog Item.
So instead of which I want to add it might be below of all the Variables.
Please suggest me on the same.
And for Service Portal do I need to add the script which you have mentioned in previous post?
So there will be two OnSubmit Client Scripts.
Thanks,
SNOW@Das

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2018 11:41 PM
You can add both if you want. One will work in native platform second on Portal.
I am no sure how to add link below item.
Maybe you can add this link as additional info but to existing variable instead of adding new one like you tried.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 01:47 AM