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

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

Recommended Posts

Posted (edited)

I have a layout that is being designed for use on an iPad, and have a value list for a record type.  For a desktop implementation, I would use radio boxes to choose the value.  However, they are too small for what I need for the iPad.  I would like to create a button that acts like a radio box, most likely based on scripting, however my attempts at doing so with SetField have not worked.

Is what I am attempting to do possible, and if so, any pointers on correct programming for these buttons?

Edited by rekent
Posted

I suggest you upload a very simple file that demonstrates what you are trying to do; including the script that you attempted.

Posted

Attached is a basic demo file.  Essentially I want the large buttons on the right to function like the radio boxes on the left (in essence giving me supersize radio boxes).  However, the SetField script is not changing the field value to the text strings that I specify.

Demo.fmp12

Posted

This is all about learning how to properly use the Set Field script step; and the various parts of this script step.

See attached screen shot and modified file.

It is really helpful to do provide an example, as you have done. It lets us see the details of how you have attempted things.

Set Field.png

DemoMOD.fmp12

Posted

Much better, and much appreciated!  It has been years since I have touched Filemaker and I knew that I was missing something - I was trying to both select the field and set the value from the calculate step rather than two separate ones.

Thanks for the assist!

Posted

A follow-up question, BruceR.

My file has two views: a thumbnail view, and the individual record view where the buttons previous described are located.  I wanted to include a single additional button on the thumbnail page that toggled between the two values, regardless of what they are.  

In the attached Function Demo, when you click the toggle, the button works properly and as expected, and the status immediately changes.  In the attached Production Demo, which is made from the actual file I am working in, you have to click the button and then click anywhere else in the layout other than on the button before the status will change.  The script coding is the same for both.  In the Production Demo, the button is located on the Thumbnails page underneath the words "New Content".

Production Demo.fmp12

Function Demo.fmp12

Posted

"you have to click the button and then click anywhere else in the layout"

You need to add a commit record statement after the set field statement.

  • Like 1
Posted

Thanks again.  That makes sense and fixed it, but I found a new problem as a result.  No matter which record I choose (e.g., New Content [2] through [5] in the attached), only the first record is changed (when using the "Toggle Type" script).  It looks like I may have to rethink this entire functionality, unless there is a modification to the code that will take the values of the particular repetition being clicked on into account. I know that I can user Get(ActiveRepetitionNumber) to determine which repetition I am clicking on, but when I try to integrate that into the script (using the "Switch Type" script) then the status change functionality no longer works (it looks like the Get function is always returning zero).

Production Demo.fmp12

Posted

Well; that's a solvable problem.

But why are you using repeating fields? 

Generally, they should be avoided, in favor of having related child records.

Posted

Quite frankly, it was initially for the sake of simplicity.  I began with one of the starter solutions because this was just a little project for personal use and I didn't want to mess with the visual layout too much,  But, as I tested it out I began changing a significant amount and adding functionality, it has ballooned into something that probably is not well suited to have a starter solution as its base.

 

Posted

Nevertheless. Converting repeats to a related table is simple enough.

So where is this going?

Posted

I plan to keep trying to improve it to function like I am hoping, but ultimately it is merely a hobby database that several people I know have asked me to share with them because they like the idea and that I will continue to use to get back into Filemaker and relearn more of it.  Which is to say, probably not worth any more of your time since it is not a serious thing.

Posted

Maybe. That is offset, to some extent, by my observations about what concepts you appear to understand and which you might learn, with a little help.

More comments to follow after you review the attached mod.

Production DemoMOD.fmp12

Posted

Ok, that fixes the functionality that I was going for here. It looks like I at least had the right basic idea in incrementing my buttons for each repetition, but my implementation was off because I hadn't thought to set it as a variable.  It also emphasizes an area that I need to work on because it touches on the aspect of Filemaker that I was always weakest on: Relationships and when/how to use them.

Now all that is left is a strange bug that I am trying to track down.  When zSort Selection is one value, the layout updates properly based on the Switch Type script, but when zSort Selection is a different value, the layout does not update properly.  I've gone through the scripts looking for any use of zSort Selection that could be altering the results, but haven't found one, so it looks like it will just require more hunting and experimenting.

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