- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 02:28 AM
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,
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 06:01 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 06:01 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 06:23 AM
Hi Brad,
yes I want to create a record based on that textarea field - work order with description and just want to attach the uploaded file / image.
Now I tried using snAttachmentHandler to write attachment on wm_order and with sys_id -1. It creates an entry in sys_attachment that is good and right file is available. but know i need to use GlideSysAttachment to copy that file to my workorder and delete that temporary file.
What would you suggest to script?
Having an textarea field + a upload icon (input type file) and a button Submit -> which just creates a new work order and attching that attachment which has been uploaded?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 06:37 AM
I would use GlideSysAttachment to copy. What have you tried so far?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 06:39 AM
Do you mean to copy the saved -1 attachment in sys_attachment?
That is not working because its not really an attachment but just a table entry.