UI action to copy field values from another Table into a Form without saving
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Team,
How to copy field values from the incident table to the RITM without saving using the Workspace UI action button.
I need to copy attachments using the same UI action.
Thanks,
Anil!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
What I did may be helpful for you, I created a UI Action and selected client callable, then configured the script to do the following ( I hope this pseudocode exercise is helpful) put the server steps in a script include:
- create an array variable to contain the interesting field names of the existing record,
- create an array variable to collect the values of these interesting fields,
- perform a GlideRecord query to find the interesting record then collect the values,
- perform a .initialize and .insert GlideRecord to create a new record in your interesting table,
- perform a value assignment using the two array variables in a while or foreach logic,
- use a GlideRecord to query the sys_attachment table for interesting attachments,
- add the new record to the attachment record (or create a new sys_attachment record for your new record using .initialize and .insert GlideRecord activities),
- set the interesting record as your new redirect url value so that it is open and visible,
For us, the attachment encryption algorithms sometimes prevents the attachment copies as the security logic is complex and fragile so handling attachments in your instance may also require more research and testing.
If this is helpful, please mark it helpful.
Kind Regards,
Woody
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
simply create server side UI action and populate the RITM associated with this INC.
You can use GlideSysAttachment.copy() to copy files from INC to RITM
what did you start and where are you stuck?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you Ankur, this was the segment I could not remember. Well done!
Kind Regards,
Woody
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader