- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 05:36 AM
Hello All,
I have a requirement to make Insert and Stay action to copy current record and also copy related list records, how can I accomplish this?
Solved! Go to Solution.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 05:50 AM
in short - you must not.
This is a global ui action, hence you must not touch it according to the best practices.
Being global UI action, there is no easy way to identify the realted records and copy them in the new rocord.
Apart from that - records in the related list may be related to the current record via the parent (or whatever) reference field, that can hold only one value. In theory, if you copy them to the new record, the relationship to the old one will be destoryed.
But as I said, you must not do that thing at all.
Please mark Correct and Helpful if my answer helps you resolve your issue. Thanks!
Martin Ivanov
Community Rising Star 2022
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 05:50 AM
in short - you must not.
This is a global ui action, hence you must not touch it according to the best practices.
Being global UI action, there is no easy way to identify the realted records and copy them in the new rocord.
Apart from that - records in the related list may be related to the current record via the parent (or whatever) reference field, that can hold only one value. In theory, if you copy them to the new record, the relationship to the old one will be destoryed.
But as I said, you must not do that thing at all.
Please mark Correct and Helpful if my answer helps you resolve your issue. Thanks!
Martin Ivanov
Community Rising Star 2022
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 05:54 AM
Hi Dominik,
You need to find the version of Insert and Stay for the table in question. The simple way is to right click on the from button at the bottom of the form and then click Edit.
If you are using a table specific version you are good to go. If not, crate a table specific version, to the table whose record you re copying and click Insert and Stay.
Once there you can either add a function to do your copying or enhance the existing function. Basically for all related lists, you will need to create a glide record which you will use to query to get the records related to the initial record. Depending on where in the process you are that will be either current or previous. From there, you just iterate through them changing the reference field to the new record and do an insert.
The coding is actually very straight forward.
Hope that helps.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
:{)
Helpful and Correct tags are appreciated and help others to find information faster