I have the following hide formula in an outline entry because I only want the entry to show up in the main database and not in other copies of the database. This doesn’t work, the entry shows up no matter what the database name. Any ideas?
@If(@Subset(@DbName;1) = “SOTool.nsf” ; 0 ; 1)
Subject: Hide based on @dbname doesn’t work in Outline
-
Are you sure the db’s in the root directory? Your condition will not work if it’s not. You might need to add an @Contains into the mix.
-
In the one db (I inherited) that uses @If in hide formulas, I set a temp variable equal to the @If return value, then make the temp variable the lst state of the formula.
Subject: Hide based on @dbname doesn’t work in Outline
Two things. The first is that @Subset(@DbName;1) is the server, not the database filename. You probably meant to use @Subset(@DbName;-1).
The second is that hide-when formula are already conditional, so the @If is a waste of effort. This would have done:
!(@Subset(@DbName;-1) = “SOTool.nsf”)
Subject: RE: Hide based on @dbname doesn’t work in Outline
Sorry - the -1 is there, it’s just either a typo on my part or the font is too small to see. Also, I usually use @if s with 0 & 1, simply so that it is easy to read and easy to add multiple conditions. I assure you the @if is structured properly and parameter I’ve coded is correct.
Subject: RE: Hide based on @dbname doesn’t work in Outline
Font too small to see? It’s the same one I used, and my “-1” shows up. Typo, perhaps, but did you actually check the code you have in place? Mistakes happen. I’ve tested mine locally, and it works for any outline entry I try it on.
If you want to go for readability, then use @True/@False instead of 1 and 0. The formula should evaluate to a Boolean both logically and semantically. No accounting for taste, I guess – I find the @Ifs get in the way of readability/maintainability and remove them when I find them in other people’s code.
Subject: RE: Hide based on @dbname doesn’t work in Outline
Hmmm. I’ve double checked my code and it is still not working. I’ll just try to find another route. Thanks for your help.