This is my latest request for a tutorial:
I want to have a layout whose fields vary depending on the value of a
field. The "selector" field is represented by radio buttons. Each button choice triggers which fields in the record are to be displayed.
I have this poorly implemented at the moment. The implementation
involves multiple copies of a layout, one copy for each button setting.
There are also several scripts. Clicking on a button runs a script that, among other things, goes to the appropriate layout copy showing the
desired fields.
This works, but it's terrible software engineering. A change to one
layout must be made, identically, to the others. A change to one script requires consideration of unintentional side-effects on the other
scripts.
There's got to be a better way, but my old Pogue book doesn't shed any
light.
Charlie
On 2018-12-01 19:47:48 +0000, Charles H. Sampson said:
This is my latest request for a tutorial:
I want to have a layout whose fields vary depending on the value of a field. The "selector" field is represented by radio buttons. Each button choice triggers which fields in the record are to be displayed.
I have this poorly implemented at the moment. The implementation
involves multiple copies of a layout, one copy for each button setting. There are also several scripts. Clicking on a button runs a script that, among other things, goes to the appropriate layout copy showing the
desired fields.
This works, but it's terrible software engineering. A change to one
layout must be made, identically, to the others. A change to one script requires consideration of unintentional side-effects on the other
scripts.
There's got to be a better way, but my old Pogue book doesn't shed any light.
Charlie
That's how I've done it in the past with old version of FileMaker Pro
(and it can be highly annoying when a customer wants a "minor" change
to the Layout which in reality means changing multiple layouts).
BUT in newer versions it's very far easier.
1. In Layout Mode, select both the field AND it's fieldname label.
2. In the Inspector Panel click on the "Data" section (the drum-like icon).
3. The second sub-set of options is "Behavior". Click on the edit button
and you can insert a calculation for when the field is displayed.
For example, if you set MyAppearingField to use a Behavior calculation
of:
(MyField = "Fred")
then MyAppearingField (and its label) will only be displayed when
MyField contains the data "Fred" (without quote marks) - if MyField
contains any other data or is empty, then MyAppearingField will not be
displayed.
You may also want to tick the little box to use the same Behaviors when
the Layout is in Find Mode. That way users can only find data in MyAppearingField when MyField has the data "Fred" entered.
Helpful Harry <HelpfulHarry@BusyWorking.com> wrote:
On 2018-12-01 19:47:48 +0000, Charles H. Sampson said:
This is my latest request for a tutorial:
I want to have a layout whose fields vary depending on the value of a
field. The "selector" field is represented by radio buttons. Each button >>> choice triggers which fields in the record are to be displayed.
I have this poorly implemented at the moment. The implementation
involves multiple copies of a layout, one copy for each button setting.
There are also several scripts. Clicking on a button runs a script that, >>> among other things, goes to the appropriate layout copy showing the
desired fields.
This works, but it's terrible software engineering. A change to one
layout must be made, identically, to the others. A change to one script
requires consideration of unintentional side-effects on the other
scripts.
There's got to be a better way, but my old Pogue book doesn't shed any
light.
Charlie
That's how I've done it in the past with old version of FileMaker Pro
(and it can be highly annoying when a customer wants a "minor" change
to the Layout which in reality means changing multiple layouts).
BUT in newer versions it's very far easier.
1. In Layout Mode, select both the field AND it's fieldname label.
2. In the Inspector Panel click on the "Data" section (the drum-like icon). >>
3. The second sub-set of options is "Behavior". Click on the edit button
and you can insert a calculation for when the field is displayed.
For example, if you set MyAppearingField to use a Behavior calculation
of:
(MyField = "Fred")
then MyAppearingField (and its label) will only be displayed when
MyField contains the data "Fred" (without quote marks) - if MyField
contains any other data or is empty, then MyAppearingField will not be
displayed.
You may also want to tick the little box to use the same Behaviors when
the Layout is in Find Mode. That way users can only find data in
MyAppearingField when MyField has the data "Fred" entered.
Thanks, Harry.
The Christmas rush got to me and once I had gotten out of the habit of looking at USENET it was hard to get back.
This information was what I needed. One quibble: The behavior that one specifies is for when the field is hidden, not shown. That pales in comparison to the useful information you gave.
I also needed to place fields (and labels) on top of each other, only
one showing at a time, of course. I could only do this using the
position specification in the inspector.
One minor irritation is still left. Whenever I change the radio button,
make the appropriate data changes, and attempt to leave the record, I
get a dialog asking if I want to accept the changes before leaving the record. I'm pretty sure I can get rid of this by attaching a script that commits the record as I try to leave, but I haven't checked that out
yet. (It's been a busy three months.)
On 2019-04-06 22:41:13 +0000, Charles H. Sampson said:
Helpful Harry <HelpfulHarry@BusyWorking.com> wrote:
On 2018-12-01 19:47:48 +0000, Charles H. Sampson said:
This is my latest request for a tutorial:
I want to have a layout whose fields vary depending on the value of a
field. The "selector" field is represented by radio buttons. Each button >>> choice triggers which fields in the record are to be displayed.
I have this poorly implemented at the moment. The implementation
involves multiple copies of a layout, one copy for each button setting. >>> There are also several scripts. Clicking on a button runs a script that, >>> among other things, goes to the appropriate layout copy showing the
desired fields.
This works, but it's terrible software engineering. A change to one
layout must be made, identically, to the others. A change to one script >>> requires consideration of unintentional side-effects on the other
scripts.
There's got to be a better way, but my old Pogue book doesn't shed any >>> light.
Charlie
That's how I've done it in the past with old version of FileMaker Pro
(and it can be highly annoying when a customer wants a "minor"
change to the Layout which in reality means changing multiple layouts).
BUT in newer versions it's very far easier.
1. In Layout Mode, select both the field AND it's fieldname label.
2. In the Inspector Panel click on the "Data" section (the drum-like
icon).
3. The second sub-set of options is "Behavior". Click on the edit button >> and you can insert a calculation for when the field is displayed.
For example, if you set MyAppearingField to use a Behavior calculation
of:
(MyField = "Fred")
then MyAppearingField (and its label) will only be displayed when
MyField contains the data "Fred" (without quote marks) - if MyField
contains any other data or is empty, then MyAppearingField will not be
displayed.
You may also want to tick the little box to use the same Behaviors when
the Layout is in Find Mode. That way users can only find data in
MyAppearingField when MyField has the data "Fred" entered.
Thanks, Harry.
The Christmas rush got to me and once I had gotten out of the habit of looking at USENET it was hard to get back.
This information was what I needed. One quibble: The behavior that one specifies is for when the field is hidden, not shown. That pales in comparison to the useful information you gave.
You're right. That should have said:
MyField <> "Fred"
so that the field is displayed when the trigger field does contain "Fred".
Not sure now whether that was a mistake, a typo, or an auto-correction
from the non-ASCII not-equal symbol.
I also needed to place fields (and labels) on top of each other, only
one showing at a time, of course. I could only do this using the
position specification in the inspector.
Another possibility, if there's a limited number of options, is the
"Tab Control" Layout item that is in newish version of FileMaker Pro.
You can put all the 'normal' fields on the Layout, and then the
data-specific ones in separate tab areas within the Tab Control (using
the example, you could have one tab for "Fred" another tab for "Bert",
etc.).
One minor irritation is still left. Whenever I change the radio button, make the appropriate data changes, and attempt to leave the record, I
get a dialog asking if I want to accept the changes before leaving the record. I'm pretty sure I can get rid of this by attaching a script that commits the record as I try to leave, but I haven't checked that out
yet. (It's been a busy three months.)
I did a quick test file, but couldn't get it to display that message,
so I'm not sure why (it may depend on what your Script is doing). I
know the newish approach to not automatically saving data can be an
anoyance in other functions though.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 235:26:53 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,767 |