- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 01:03 PM
I need some help with a BR. I've tried everything I can think of to get it to work. I tried to do it with the Set Values in the BR with no luck.
Record Producer to Open a Request on Table "sn_sm_legal_request" - Then it creates a Task on table "sn_sm_legal_task" - The group that gets it needs to complete a question called CPA approved with a value of yes or no "u_cpa_approved" - There is a Question that needs to be set on Request Table "sn_sm_legal_request" with the same value.
So on Task answer Question and when that task is closed it updates the Request- Both values are same u_cpa_approved
Any ideas? - Thanks so much... I've been working at this for hours.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 01:50 PM
I understand. They have the same name, but they are on two different tables. That's not an issue at the database layer.
The line in my script (updated per your screenshots) does the work of copying the value from task's field to the requst's field.
req.u_cpa_approved = current.u_cpa_approved;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 01:19 PM
Create an AFTER business rule on the task table something like this.
note, this is not meant to be a copy/paste solution - review an update accordingly. I don't know the parent field that links the request to the task as I don't have that plugin activated currently.
Name: Update parent CPA Approval
Table: sn_sm_legal_task
Advanced: true
Insert: true
Update: true
When to run: After
Condition: CPA Approval | changes
Script:
(function executeRule(current, previous /*null when async*/) {
var req = new GlideRecord('sn_sm_legal_request');
if (req.get(current.parent)) {
req.u_cpa_approval = current.u_cpa_approval;
req.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 01:32 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 01:40 PM
Thanks for the screenshots! Big help!!!
It can be named the same thing. No issue there. They are two different fields on two different tables.
I believe I called it 'u_cpa_approval' in my script. Did you change that to 'u_cpa_approved'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 01:46 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 01:50 PM
I understand. They have the same name, but they are on two different tables. That's not an issue at the database layer.
The line in my script (updated per your screenshots) does the work of copying the value from task's field to the requst's field.
req.u_cpa_approved = current.u_cpa_approved;