Best way to handle attachments in serviceportal

Felix20
Mega Guru

Hi everybody,

i have a page on which is a textarea field and and a input field for files. I know there is a snattachhandler but that handler uses a table and an entry to attach it to, but at the time the use presses the button there is no enrry.

what is the best way to handle attachments in serviceportal pages? When i use a custom widget without form?

 

Best regards,

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

There may be an external library you could use. Also, if you want to use the default functionality but it requires a record to be created, why not create the record at the time someone uploads an attachment? It's going to need to be associated with a record eventually anyway, right? If they end up abandoning the form you could do some sort of scheduled cleanup of those records.

View solution in original post

5 REPLIES 5

Felix20
Mega Guru

I finally did it like this.

I call backend to create the record and wait till it get back to my called function in client script and get the record id from response and use snAttachmentHandler in client script to attach uploaded image to my work order record

thanks Brad