I have a requirement in record producer where the 'state' field and Assigned to field

Trupti Krishnam
Tera Contributor

The state field should show If answer to all Yes/No questions is "Yes" set to Closed complete
Else set to Work in Progress and clear Assigned to and the assigned to field If answer to all Yes/No questions is "Yes" set to the user submitting the record
ELSE set to NULL

 

 var abc = producer.v_top_light_yn.getDisplayValue();
 var qaz = producer.v_info_button_yn.getDisplayValue();
 if (abc == 'yes' && qaz == 'yes') {
    current.assigned_to = producer.opened_by;
    current.state = '3';
} else {
    current.assigned_to = '';
    current.state = '2';
}
I have written the above code .., i m not understanding where i m going wrong.
1 REPLY 1

Prince Arora
Tera Sage
Tera Sage

@Trupti Krishnam 

 

Can you update the script as below and let me know if it worked

 

var abc = producer.v_top_light_yn.getDisplayValue();

 var qaz = producer.v_info_button_yn.getDisplayValue();

 if (abc == 'Yes' && qaz == 'Yes') {

    current.assigned_to = producer.opened_by;

    current.state = '3';

} else {

    current.assigned_to = '';

    current.state = '2';

}