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

Conditional button in layout?


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

Recommended Posts

  • Newbies
Posted

I have a container field in a table (using FM 8.5) which holds a document. I can set up a button to display the document, but I'd like for the button to only be visible in the display if there are actually contents in the container field. I can't quite figure out how to optionally manage the presence of the button in the layout. Does anyone know how this might be done? Thanks!

Posted

it seems to me that the button will be there regardless of whether there is anything there or not - its just "invisible" or looks like a button.

If you take a button icon and copy and paste it into a global field then you can create a calculation called "Show button"

Lets say you have the field "Document" which is your container.

Create the field called "Global_Button" which is a Global Container field - insert the button into this field. Close the file and reopen it to keep the value there. if you are using fm server - you have to open the file locally - store the global and then reopen it on the server.

then create a calculation: "show_button" - which is a calculated field: if(isempty(field:document),"","global_button) - make certain that the type is "container".

then assign this field to the actual script that you want.

I do this - but use a repeating field for my global_button - and have 2 repetitions - one is a "dimmed" button, and one is a "highlighted" button - in this case the calculation changes to:

if(isempty(field:document),getrepetition(global_button,1),getrepetition(global_button,2))

  • 2 weeks later...

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