Help with a Business Rule across multiple tables

Wendy Peterson
Giga Guru

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.

1 ACCEPTED SOLUTION

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;


View solution in original post

12 REPLIES 12

For some reason now its working. All I did was hit debug and then there was that value in the attribute not sure what it's for but i cleared that out. I didn't add it to begin with maybe that had something to do with it.



Thanks so much for your help..



2016-09-13_15-45-09.png


I'm glad you got your question answered. Thank you for participating in the community.


Mihir Mohanta
Kilo Sage

1. Write a after update business rule in the sn_sm_legal_task table.


2.Glide query to the sn_sm_legal_request table .



var expdt = new GlideRecord("sn_sm_legal_request");


expdt.addQuery(current.parent,expdt.sys_id); //in place of bold text write the field name used to reference the request


expdt.query();


if(expdt.next())


  {


expdt.u_cpa_approved=current.u_cpa_approved;


expdt.update();


}



Make sure that choices of u_cpa_approved fiel are same in both request and task.




Thanks,


Mihir