Jump to content
Server Maintenance This Week. ×

Conditional buttons


jdjd

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

Recommended Posts

This must be so elementary I can't find anything about

it in the forums.  Forgive me, be as tolerant as you can ...

 

I've got FMPro 12;  on an iMac.

 

I've made a database of about 2000 people ("A").

And I've got a file ("B") of portraits of about 250 of them.

 

I have a button in A:  it uses the ID of a person

to find an entry in the portraits file B.  All that works fine.

 

Two problems:  

 

    1.  It would be good to grey out the button if the person

    hasn't got a portrait ---saves time, and is considerate to

    the user.   How do I do that?

 

    2.  Some of the people in A have got more than one portrait

    in B.  My working button finds the first one, but gives no

    indication that there's a second one; nor of course access

    to it.  Is there an elegant solution?

 

All help gratefully received.

 

jd

 

 

 

 

 

 

Link to comment
Share on other sites

 but gives no indication that there's a second one; nor of course access to it.  Is there an elegant solution?

 

Why is that “of course”?

 

Try this example, which uses Conditional Formatting and the Go to Related Records script step. There's room for improvement; e.g. the whole window handling routines should be in their own scripts, because with some parametrizing, they're fairly universal applicable. Also, this example needed some example data, thus the portals; but you don't actually need them on the layout. 

 

btw, you could replace the calculation field with a variable, but then you'd need to declare a variable dynamically for each user, keep track of changes to initialize and update it, take care of screen refreshing etc, which might be a bit of a codeful at this stage.

CFButton_eos.fmp12.zip

Link to comment
Share on other sites

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