Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I would like to know how I use a script to uncheck a checkbox. Its a simple value list that contains one value "ADD", when checked it allows that record to be viewed in a portal with others that were checked. I know how to write the script that runs through each record, but I don't know how to make it uncheck the checkbox when it finds one thats is checked.

Help anyone?

Posted

There are several methods, probably the easiest is the replace field contents function. This requires the field your are applying it to be in the active layout. Be very carefull with this function as you can loose all data in a field for the entire database, as it replaces all records data in the found set for the chosen field.

Another way is the set field step, this would require looping thru the records as set field works only on the current record. I highly recommend you back up before experimenting with the replace field contents step.

Replace field contents can also be found in browse mode by using the Record menu command, here you enter the field, change the data, do not commit the record(leave the cursor iin the field), then go to the record menu choose replace field contents, it works on the found set.

Rod

Posted

If you wanna clear all the checkboxfields you could just write:

Setfield(checkboxfield;"")

or

If (not IsEmpty(checkboxfield)

Set field(checkboxfield;"")

if you only want to clear the ones with ADD...

If(checkboxfield="ADD"

SetField(checkoboxfield="")

The first one should clearly be the fastest....

Posted

Thank you for your replies, unfortunately none of your solutions work. The problem lies, I think, in the fact that the information comes from a value list. If the box is checked, then the value "ADD" is set to the field. Since there are no other values in the value list for that field, setting it to "" does not seem to uncheck the box.

Any other suggestions?

Posted

Cat -- I can assure you that setting a field to "" WILL uncheck the checkbox. It will be an empty field.

You may be seeing (or not seeing) the portal not being refreshed. Try this: clear the field, then change into Preview mode, then back into browse mode to force the screen and portal to refresh completely.

Make sure you are upgraded to FMP 7.0v3 as it has an option in the Refresh Window step to refresh relationships.

This topic is 7320 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.