Clear a record producer variable based on value of another variable

WP2
Kilo Guru

Hi All,

I have two record producer variables

1. week_day / Type is checkbox

2. screened_date / Type is Date

The use case is when week_day is checked, screened_date should clear out (this is if a value has already been entered) and should not display on the request. I think an onChange client script can do the trick. Please provide guidance.

Thank you.

 

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

Try this:

if(newValue=='true'){
g_form.clearValue('screened_date');//Clearing the feild
g_form.setVisible('screened_date',false);//Hiding the field
}

Thanks,
Ashutosh

View solution in original post

4 REPLIES 4

Chander Bhusha1
Tera Guru

Hi Rich,

 

Write an onchange client script on the week_day field.

Script would be:

var ch = g_form.getValue('week_day');
if(ch=='true'){
g_form.clearValue('screened_date');//Clearing the feild
g_form.setVisible('screened_date',false);//Hiding the field
}

 

mark helpful and correct if it helps.

Thanks,

CB

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

Try this:

if(newValue=='true'){
g_form.clearValue('screened_date');//Clearing the feild
g_form.setVisible('screened_date',false);//Hiding the field
}

Thanks,
Ashutosh

Hi Ashutosh,

This was very helpful.

I am also looking to clear the value of two variables (type = date/time) mapped to Planned start date (start_date) and Planned end date (end_date) fields on change request form when "week_day" is unchecked (this is if values have already been entered)

How can i achieve this please?

Android
Tera Contributor
متي يمكننى الانخراط والتواصل مع المجتمع شكرا