True/false field when saving changes to false

Elizabeth26
Tera Contributor

I am experiencing a strange issue in a table. 

I have a true/false field that is shown in a onChange script after certain criteria is met.

In scenario 1: The field shows and someone checks the box. Then when it saves the box is no longer checked.

It's the same field name. 

I do have a view that's different before it's saved and after but it's the same field name.

In scenario 2: I have in the script to automatically check the box when certain criteria apply - this works even after saving.

I also notice when I look in the list view the field shows "true" and when I open the record the box is still unchecked (based on the first scenario above).

Is this a bug? Or, something else I am doing that's causing this?

I ran a code search and this field is only being called in this script and no where else.

Thanks!

4 REPLIES 4

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Elizabeth,

Does the field being saved to the table correctly or does the checkbox become unchecked when the form is re-opened?

If it's being unchecked when the form is re-opened, there's probably a bug in the script. Also, check if there is an UI Policy on the form.

I believe it's saved to the table correctly as the list view shows "true" for this field. It's just showing unchecked when I open the form. 

There are UI policies but none that involve this field. 

In the onChange() script, is there the following default if condition? If so, the script won't run when the form is re-opened. Try inserting an alert as the second row to display the value of the field. Also, check there is no display business rule.

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

 

Yes, I have onChange and I also have an onLoad script with the same information so that it displays onLoad.