Reference field from Parent

SG23
Tera Expert

Hi Guys, I have a field 'Account' on the Problem which is of type reference. But when I'm adding the same to the Problem Task the field is showing empty value on the Problem Task form. The scenario is to have same 'Account' value for Problem and Problem task. Please suggest. Thanks

1 ACCEPTED SOLUTION

Mahesh Baraskar
Mega Guru

@SG23  Hello,

 

You have to write before insert and update BR for this.  You can write following code in this.

 

current.setValue('u_account', current.parent.u_account);

 

Please mark as helpful if this solves your question.  Let me know if it does not solve and post some screenshots so that I can help you better.

View solution in original post

3 REPLIES 3

Dhruv Chandan
Giga Guru

Hi @SG23 ,

 

Following are some of the ways to achieve this.

 

1. You could write a Business rule to push values from the parent problem record "Account" value to problem task record.

 

2. An onLoad client scirpt which will do an ajax call to populate value in the "Account" field on load of a problem task form.

 

Hope this helps!

 

 

Mahesh Baraskar
Mega Guru

@SG23  Hello,

 

You have to write before insert and update BR for this.  You can write following code in this.

 

current.setValue('u_account', current.parent.u_account);

 

Please mark as helpful if this solves your question.  Let me know if it does not solve and post some screenshots so that I can help you better.

DrewW
Mega Sage
Mega Sage

I would not create an account field on the problem task table.  Simply just add the Account field from the problem that is referenced in the problem field which you can do using the Configure/Form Layout menu option.

 

The only reason I would add the Account field to the problem task table is if the problem task could have a different account than the problem it is attached to.  In that case I would use some of the other suggestions on copying the value from the problem to the problem task.