- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 08:04 AM
Hi All,
I was given a task to do something that seems simple but I'm having a tough time figuring out the right way.
I have 2 check boxes.
SID Vendor (True/False)
and
Insurance Required (True/False)
Here's what I need.
When SID Vendor is set to true, I need the Insurance Required box to be set to true. In a UI Policy/action, I can't set the value. In a Business rule, I can't set the value until insert or submit.
Is there a way to set the Insurance Required value to true while still on the form? Is that a client script?
Hope that makes sense!
Thank you!
Carl
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 08:08 AM
Here you go
create an onChange client script on SID vendor field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue=='true'){
g_form.setValue('ur second checkbox field name goes here',true);
}
else{
g_form.setValue('ur second checkbox field name goes here',false);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 08:05 AM
Carl,
You need an onchnage client script for this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 08:08 AM
Here you go
create an onChange client script on SID vendor field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue=='true'){
g_form.setValue('ur second checkbox field name goes here',true);
}
else{
g_form.setValue('ur second checkbox field name goes here',false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2016 12:51 PM
Works perfect! thank you. You solved my issue in less tan 10 minutes!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2019 10:23 PM
Hi Abhinay,
I have almost the similar kind of condition where I have a string field based on which Another field(True/False) needs to be auto-populated. Below is the script I wrote, however that isn't working for me.
TestType(string)
CD: (true/False)
function onChange(control, oldValue, newValue, isLoading, isTemplate){
if (isLoading || newValue == '') {
return;
}
if(newValue=='CDL'){
g_form.setValue('u_cd',true);
}
else{
g_form.setValue('u_cd',false);
}
}
Regards,
Venkat