How do I copy one array (i.e. List) to another in a business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 08:51 AM
I need to copy an array (List) from the Idea table to a new Project record that has another field setup exactly the same way. A straight-up 'setValue' doesn't work.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 10:18 AM
I think I found the solution here: Copying array by value in JavaScript - Stack Overflow
BR Script, array stuff in bold:
var proj = new GlideRecord('pm_project');
var newArray = current.source_field.slice();
proj.setValue("target_field", newArray);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2021 04:38 PM
Hi Shane,
I have a similar requirement and would really need some guidance on how i can achieve this.
I dont seem to be able to work out this one.
Regards,
Surabhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2021 06:55 AM
Can you provide the details for what you're trying to do? I can't do much with that. 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2021 07:23 AM
Hi Shane,
I have created a custom field "Impacted company" on risk form which is a list type field. I have not picked a reference tables as per the requirement and created 5 values in the dictionary entry. If i select a value in that field during risk creation, i want the same value to be copied or carry forwarded to acceptance task during its creation. Is there a way to achieve it? i am pretty new to scripting. tried business rule direct assignment functionality but that's not copying the values.(attached images for reference)
Any help would be really appreciated.
Thanks
Surabhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2021 08:39 AM
If your Acceptance Task is a child of the Risk record, why not just show the 'Impacted Company' field from the parent on the child form?
Than you don't have to deal with copying these over. Will that work instead, or do you really need the values copied over?
