Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Container field button / set field func /


Recommended Posts

I'm constructing a graphic dental chart. Each patient has up to 32 teeth, each tooth has 5 surfaces for a total of 160 tooth surfaces. (Imagine each tooth as a cube with the root attached to one of the six surfaces.) Each tooth is then represented by 5 small touching squares arranged in the form of a cross. Each square is also formatted as a button which triggers the color-changing script.


Each square is a "container" field which holds a particular color, depending on whether that part of the tooth is decayed (red), filled (blue), crowned (gold or porcelain color), etc. The color assigned is determined by a Color Selector field, displayed as radio buttons, one button for each color.


My current script first ascertains which color is selected at the moment - an If statement - and then fills that particular square with the chosen color using the Set Field function. Trouble is, unless I use the "specify target field" aspect of Set Field, the script doesn't know which of the 160 squares I have clicked. I don't want to have one script associated with each individual square, because that would mean 160 different scripts, all saying almost the same thing; the only difference being the square specified.


So my question is: how can I use just one script (rather than 160) which will recognize both the square/field/button and the selected color? Another way to phrase that is: how will the script know which field/button I have clicked without using "specify target field" which seems to require only a specific field reference taken from the list presented, rather than a calculated one.


A segment of the current script reads:

If [Charting::Color Selector = "Decayed"]

Set Field [Charting::T01F; Charting::Color Red Container]

End If


It works, but requires specifying the field T01F, which is short for Tooth 01, Facial surface. I don't want to write script after script for fields T01L, T01M, T01D, etc. Help, please.

Link to comment
Share on other sites

are any of your container fields repetitions? ie your cross formation of container fields, is this one field with say 6 repetitions? or six fields?


I guess what Im trying to say is its really hard to give any kind of answer without really seeing what you are trying to describe. is it possible to post a sample of the file you are having problems with?

Link to comment
Share on other sites

Here is an idea though in the mean time if you can follow:


Name each container field on your layout with an object name. and turn your containers into buttons by attaching a single script to them.


The script (very broadly) might go something like:


Set Variable [ $ThisObject ; Get ( ActiveLayoutObjectName ) ]

Go to Field [ Container Colour ]


Go to Object [ $ThisObject ]





I dunno if thats going to work, you might need some if statements in there to determine what colour to copy, or even if copy works with contianer field contents, but worth a shot.


short of that, passing a single script a script parameter that somehow lets the script know exactly what was chosen might be an idea (ie the containers object name).

Link to comment
Share on other sites

Weetbix: Thanks for the quick reply. None of the fields contain repetitions. Haven't tried that approach yet. I thought I'd get it working as individual fields first.

Link to comment
Share on other sites

I have separated out the necessary components into a much smaller file - attached. I'm sending it along with the jpg's which I think will be needed to generate the colors in the container fields. I wanted to send a 6th file, but exceeded my maximum of 5. What's missing is the erase.jpg file, which contains essentially no color at all and is used to remove any existing color.



Link to comment
Share on other sites

Doug, I'm not a dentist (although I have some insight from the other end of the drill!) but I'm hoping that this will help.

It looks like you're selecting the color first, then trying to assign that color to a portion of a particular tooth. Since you're dealing with the tooth, wouldn't it work as well if you first selected the tooth portion, then assigned a color to that portion?


With that assumption, you can create four global containers, each with an appropriate color. You can do this in a paint program:

Create a box filled with a color, copy that color, then back in Filemakerbrowse mode, paste into the container field. Do this with each of the four containers. In the attached sample, the fields are named "red", "blue", "gold", and "porcelain".


You can use your tooth setup you made in your sample file, but just set them up as container fields, and use the graphic format to enlarge the image to fit the frame.


Next, create five buttons, one for each color, and one to clear the color from the tooth portion.


You'll need five scripts, one for each button. Each color button will be assigned a script:

Insert Calculated Result [select; FileName::red]

Commit Records/Requests


Because you don't select go to a target field, the color (the calculated result) will fill whatever container field your cursor is in when run the script.


Three more scripts, changing the FileName::red to FileName::blue, etc.


The fifth script clears the tooth portion:

Clear [select]

Commit Records/Requests


Now you're ready to try it out: Place your cursor on the portion of the tooth you want to color, then click the appropriate button. Voila!


I think a touch screen would really make this an easy program to use.


I've attached a sample file that you can take apart and use whatever portion that might work for you.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use