Jump to content

checkbox prefill


This topic is 6949 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am creating a report layout that retrieves data from another layout in the same database.

There is Sales Tax section that I put 3 checkboxes for DC, MD, VA. I want to do "If state = "DC", check the DC box automatically." same to MD and VA.

Another feature, even one box is pre-checked, users want the flexibility of unchecking it and checking another one.

I created 3 fields, TaxDC, TaxMD, TaxVA, and specified them with each checkbox.

The Value List used for the checkboxes is "Yes", which value is simply 1.

First, I set those 3 fields as "calculation" fields. I put "If(state="DC", 1, 0)" in TaxDC; same calculation with state="MD", state="VA" to TaxMD and TaxVA.

The checkbox was checked correctly in the report. However, I was NOT able to uncheck the box and check another one. in Filed Format of each box, "Allow entry into field" is checked.

So I tried the second method. I changed these 3 fields to Number fields. Then in Options, Auto-Entry, I did the "Calculation Value" - "If(state="DC", 1,0)". Now, none of the boxes was pre-checked at all. But I could check them manually.

I am not sure where I did wrong. Please help.

Link to comment
Share on other sites

Try using

State = "dc"

for your auto-enter calculation on TaxDC, with 'do not evaluate if all referenced fields are empty' selected. Note that this is the simplified form of If( State = "dc", 1, 0 ).

The calculation will only be evaluated when the record is first created, once State has been given an intial value. It will not update existing records-- you will need to use a Replace, or Set Field loop in a script, in the field itself with the above calculation, to update existing records--nor will its value change when you change the State field. Once it is set initially, interaction is required to change its value, which is what you seem to want.

Link to comment
Share on other sites

thank you for the reply.

So for these 3 fields, taxDC, taxMD, taxVA, I should set Auto_Entry, Calculated Value - State="xx". right?

How to do the script to capture the new value if the state is changed? Also, how to set "run this script automatically when this layout is opened"?

Thank you

Link to comment
Share on other sites

This topic is 6949 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.