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-12-2018 02:00 AM
Hi
In the above script try with this
var isOnServicePortal = parent.document.URL.indexOf('your_portal_id?id=sc_cat_item') != -1;//for example https://XXX.service-now.com/sp?id=sc_cat_item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 02:40 AM
Hi,
An attachment should be attached to the specific catalog item. And you can use the UI Macro as
<a href= "/sys_attachment.do?sys_id=xxxxxxxxxxx" target = "_blank">Click Here</a> to download.
Use the Macro variable to download a form.
Client Script : OnSubmit
if(current.hasAttachment(true))
{
alert("msg");
}
Thanks,
Vinu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 03:14 AM
Hi Vinu,
Can you post some screeshot for me like how can I achieve the same?