
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 04:51 AM
Hi,
Can anyone advise where this script is going wrong please.
On a demand record we have created a list collector field which references cost centre table. A user can select one or many cost centres to associate to the demand.
When the demand is approved, a ui action calls a script include to create a project record associated with that demand. No issues at all with this. As part of the project creation process we want to pass the cost centres selected into a related list on the project record called Affected Cost Centres, and have added the following into the script include:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 05:27 AM
Check the Cost center field name on the task_cost_center table. It should be
gr.cost_center = arr[i];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 05:17 AM
Hi @Cirrus ,
Update below line of code in your script
var cost = demand.u_costing_code.toString();
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 05:19 AM
Hi @Cirrus
can you Replace the below line
var cost = demand.u_costing_code.toString(); //instead of getvalue
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 05:27 AM
Check the Cost center field name on the task_cost_center table. It should be
gr.cost_center = arr[i];

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 05:35 AM
Schoolboy error, well spotted!