Copy Related Record to New Record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2011 07:44 AM
Basically, I am wanting to be able to copy all of the field attributes from one record into a new record, yet substitute just a few.
Rather than specifically call out every field such as the following:
current.assigned_to = producer.assigned_to;
I would like to just rather do a while loop where I could say something like this:
while(array.length > 0 ) { current.array[x] = producer.array[x]; }
Any suggestions on what that coding would be? I am not sure how to get the fields in the array. I have done something simliar with catalog items where I declared all the variables on a form, but how do I get all the fields in a record?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2011 01:24 PM
Tony, that is awesome! Thank you so much for your insight and help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 03:02 PM
Hi guys,
I know this is an old post.. This maybe out of the context but just want ask how can I add all the related records when copying a change?
currently only Affected CIs, Impacted Services/CIs, and Change Tasks are able to be copied over to new change.
Any idea how can I achieve this? I tried editing the 'Copy Change' UI Action but I failed, nothing happens.
any suggestions what else should I change to make this work? I'm gonna be honest, I'm not that good when it comes to scripting BUT I'm trying. Maybe you guys can help me with that too. 🙂
Just in case you came across with this question, your help will be much appreciated, Thank you in advance!