- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2023 07:17 AM
I have a business rule that runs when a work order task is filled in, it also auto fills that same field to match in the parent work order. Ive already tried changing the script and ive tried changing it to not run on empty fields. But it keeps doing it.
The problem is multiple task all have the same fields and they are meant to be filled in one by one in each task. So everytime a new task field is filled in the other one gets erased how can i resolve this thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2023 08:03 AM
Sorry, about that.
(function executeRule(current, previous /*null when async*/) {
var workorderParent=current.parent.getRefRecord();
if (JSUtil.notNil(current.u_am_submit)){
workorderParent.u_submit_am = current.u_am_submit+'';
}
if (JSUtil.notNil(current.u_task_submit_client)){
workorderParent.u_submit_client = current.u_task_submit_client+'';
}
if (JSUtil.notNil(current.u_task_client_interview)){
workorderParent.u_interview_client = current.u_task_client_interview+'';
}
if (JSUtil.notNil(current.u_task_rs_interview)){
workorderParent.u_interview_rs = current.u_task_rs_interview+'';
}
workorderParent.update();
})(current, previous);
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2023 08:00 AM
Thanks for the quick reply peter. Im getting an error.
"Could not save record because of a compile error: JavaScript parse error at line (5) column (39) problem = missing ) after condition (<refname>; line 5)"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2023 08:03 AM
Sorry, about that.
(function executeRule(current, previous /*null when async*/) {
var workorderParent=current.parent.getRefRecord();
if (JSUtil.notNil(current.u_am_submit)){
workorderParent.u_submit_am = current.u_am_submit+'';
}
if (JSUtil.notNil(current.u_task_submit_client)){
workorderParent.u_submit_client = current.u_task_submit_client+'';
}
if (JSUtil.notNil(current.u_task_client_interview)){
workorderParent.u_interview_client = current.u_task_client_interview+'';
}
if (JSUtil.notNil(current.u_task_rs_interview)){
workorderParent.u_interview_rs = current.u_task_rs_interview+'';
}
workorderParent.update();
})(current, previous);
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2023 08:14 AM
Thank you so much for the help Peter. Worked like a charm!