eljefejb Posted April 22, 2005 Posted April 22, 2005 Greetings, oh wise ones! I have searched and searched, but have yet to find much information on whether it is possible to hide an empty field on a layout, but show the rest of the record. Specifically, I have a layout for required tools and supplies. Its table contains fields for item name, whether or not the item requires an MSDS sheet (Yes/No) and a container field which will hold the link to the MSDS PDF file (if one is required). Is it possible to hide the link field if it is empty, but show it (with border) if non-empty? Thanks in advance, Jeff
LaRetta Posted April 23, 2005 Posted April 23, 2005 Hi Jeff, Here's a bare-bones example. It uses the invisible portal technique to make or break a relationship and display the container in a portal only when MSDS = "Yes." You can also change those match fields to whether the container is empty or not but it seems that if MSDS = "Yes" then you would want the field to display even if it doesn't contain a PDF so you'll know you need one - or staff can insert it. Anyway, this is the idea and invisible portals can be based upon just about anything. I prefer using 1/0 instead of yes/no. I use one Value List called Select with a 1 in it. Then I can attach the same Value List to many many yes/no toggle situations. And, as in this case, it could take advantage of Boolean logic and produce a cleaner relationship. LaRetta hide.zip
eljefejb Posted April 25, 2005 Author Posted April 25, 2005 Nice! That seems to do exactly what I want it to do. Took me a while to pick apart your example and stick it in my head (), but I think I understand it now.
eljefejb Posted April 26, 2005 Author Posted April 26, 2005 LaRetta, Portals are new to me, (I'm used to PHP/MySQL type systems... still just an FMPro newbie ) so maybe I'm not understanding something about the workings, but I see a problem. When there is only one record, your example is perfect... does everything I want it to. When I add a new record, however, it behaves strangely. If the MSDS radio button is set to "Yes" when the new record is active, I expected the portal to display the container field with nothing in it, since I had only added a PDF link to the first record. However, it displays the same link that was entered in the first record! That shouldn't happen, should it? Shouldn't one be able to add a separate PDF for each record, if one is required? Confoozled, Jeff
eljefejb Posted April 26, 2005 Author Posted April 26, 2005 I think I solved the problem... I had to add something like "ItemName = ItemName" to the self-join relationship in order to get it to show the correct record. I thought I had tried that before my last post and it didn't work, which is why I was so confused. I must have clicked the wrong field on accident on one side of the relationship when defining the criteria. It seems to work now! *shrug* Thanks again for the help. You'll see me next time I have a problem!
Recommended Posts
This topic is 7152 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 accountSign in
Already have an account? Sign in here.
Sign In Now