How to auto populate a checkbox with the default value "true" on CI form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 03:54 AM
Hi All,
I have two check boxes on CI form such as "Security BIA" and "BIA Result".
So i want to auto populate "BIA Result" field with the default value true if "Security BIA" is true.
With the help of UI policy and UI action I am able to auto populate the checkbox but now sure how to make it true by default.
Thank you,
Priya.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 04:20 AM
Right click on field Go to Configure dictionary, under Default Value tab, give the value as true.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 06:06 AM
Hi,
That is not working Harish.
Thank you,
Priya.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2020 03:36 AM
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2020 04:41 AM
It doesn't seem like you're really talking about a 'default value' here, as the check box is dependent on another box being checked. Default value only applies when a new record is added to the table. If what you want to do is keep the 2 check boxes in sync, then there are a couple of approaches. If "Security BIA" is being set to true/checked by a user interaction on the form, then an onChange client script will show the "BIA Result" box also being checked - and unchecked when Security BIA is unchecked.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue == 'true'){
g_form.setValue('u_bia_result', 'true');
}
else{
g_form.setValue('u_bia_result', 'false');
}
}
If "Security BIA is already checked when the form loads and isn't expected to change whilst the form is being viewed, then a business rule running before update on the ci table is a better way to go as it will set the BIA Result checkbox whenever and however Security BIA is checked/unchecked (API, List View, Form View,...) you just won't see the box being checked on the form like you do with an onChange client script. You can have both if needed, they won't be in conflict.
The business rule won't require any scripting, just build the Filter Condition Security BIA changes, then on the Actions tab, Set field values BIA Result Same as Security BIA.