How insert attachments to a new record

Alon Grod
Tera Expert

Hi,

 

I added an attachment to an existing incident record. Now I want to add this attachment to a new incident form (before the new incident is created) using onLoad client script.

how can I achieve that?

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@Alon Grod 

incident can only be attached for a record which has sysId

When new incident form is loaded it doesn't have sysId and hence this is not possible.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

That’s not true, you do have a sysId before creating the incident @Ankur Bawiskar 

@Alon Grod 

what's the point in adding file to a record if user doesn't submit the new record?

Can you share the sysId which gets associated to the new record and how to get in onload client script?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Mark Manders
Mega Patron

Why before the new incident is created? If the incident isn't really created, you will have an attachment linked to nothing? Why not simply use a flow and the 'copy attachment' action?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark