How to Populate a List field reference value on another list field

Priya Singh 2 2
Tera Contributor

Hi Team,

I have a list type field called as control objective on Policy Exception table (Referring to Control Objective), when we open Control Objective form we have a string field called as reference as below :

PriyaSingh22_0-1721235271076.png

Now my requirement is that I need to create another list type field where I have to show all selected control objectives (Control Objective field on Policy Exception form) reference values in newly created field , separated.

 

I created before update BR & below is the script -  BR is on Policy Exception Table & condition is Control Objective Changes and Control Objective is not empty

PriyaSingh22_1-1721235558659.png

I can show same control objectives on newly created field however I am not getting how I can populate reference values for all selected control objectives from Control Objective field to newly created list field.

 

Please advise team.

 

 

1 ACCEPTED SOLUTION

Namrata Ghorpad
Mega Sage
Mega Sage

Hi @Priya Singh 2 2 ,

Update your business rule script like below and try.

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var con=current.getDisplayValue('field name of control objective list').split(',').toString();
	gs.addInfoMessage(con);
	current.setValue('u_referenceField',con);
	current.update();

})(current, previous);

 

 

Please mark my answer as correct and helpful if it helps to resolve your issue.

Regards,

Namrata

View solution in original post

2 REPLIES 2

Priya Singh 2 2
Tera Contributor

@Ankur Bawiskar Kindly advise on above requirement.

Namrata Ghorpad
Mega Sage
Mega Sage

Hi @Priya Singh 2 2 ,

Update your business rule script like below and try.

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var con=current.getDisplayValue('field name of control objective list').split(',').toString();
	gs.addInfoMessage(con);
	current.setValue('u_referenceField',con);
	current.update();

})(current, previous);

 

 

Please mark my answer as correct and helpful if it helps to resolve your issue.

Regards,

Namrata