You could create a text object with the field name ( for example CITY ) and apply to it the condition to hide if:
not IsEmpty ( CITY )
To be honest, I would use an approach similar to suggested by Daniele Raybaudi. But for completeness I can suggest an alternative:
Set the same field to Auto-Enter, Calculated Value - check, Do not replace existing value of field - check and add the calculation:
Right ( GetFieldName ( Self ) ; Length( GetFieldName ( Self )) - Position ( GetFieldName ( Self ) ; "::" ; 1 ; 1 ) -1)
The formula is generic, you can paste it to any field
Sorry nicolai, but filling a field with a value that has a different semantical meaning for what the field was originally purposed for is just nonsense. And also your proposal does not work for number fields.
And also your proposal does not work for number fields.
it does work, provided you do not force validation. You can enter text in the number field including Auto-Enter.
filling a field with a value that has a different semantical meaning for what the field was originally purposed for
Agree. I did say, that personally I would not use it this way. I think my answer was a bit abstract, as Daniele Raybaudi has provided the correct answer already
is just nonsense
You are off my Christmas Card list.
is just nonsense
You are off my Christmas Card list.
Yes, my remarks are sometimes pointed. But here I stand at my point.
Your proposal violates the data domain integrity principle in relational databases, one part of data integrity.
Having an empty value in a field is much better than having a value which is not in its accepted domain.
Dannielle's basic approach is good. Suggested enhancements:
1) If you're in Find mode, you don't want the label to appear. It'll be a distraction to users.
2) If the focus is in the field, you don't want the label to appear. It will interfere with the user typing information.
The first condition can be handled with Get ( WindowMode ) ≠ 0. The second can be handled with GetLayoutObjectAttribute ( objectName ; "hasFocus" ).
The only other enhancement involves the use of this technique in a portal. It's useful (although not absolutely necessary) for the field label to disappear only in the particular row where the cursor is. For your intellectual amusement, here's a calculation I use in a current project for that purpose.
Let ( [
tableName = "equipmentStatusAssignment" ;
fieldName = "comments" ;
fieldValue = Evaluate ( tableName & "::" & fieldName ) ;
"SELECT " & tableName & "." & tableName & "ID" & " " &
"FROM " & tableName & " " &
"WHERE " & tableName & ".equipmentType = 'RPD' AND " & tableName & ".recordBookID = ?" ;
queryResult = ExecuteSQL ( sqlQuery ; "|" ; "¶" ; recordBook::recordBookID ) ;
queryResultBracketed = "¶" & queryResult & "¶" ;
resultPosition = Position ( queryResultBracketed ; "¶" & Evaluate ( tableName & "::" & tableName & "ID" ) & "¶" ; 1 ; 1 ) ;
currentRow = Case ( resultPosition > 0 ; Floor ( resultPosition / 38 ) + 1 ; ValueCount ( queryResult ) + 1 )
not IsEmpty ( fieldValue ) or
Get ( WindowMode ) ≠ 0 or
( GetLayoutObjectAttribute ( tableName & fieldName ; "hasFocus" ; 0 ; Get ( ActivePortalRowNumber )) and currentRow = Get ( ActivePortalRowNumber ))
First of all, I am not defending my suggestion or suggesting that it is a solution (as it was stated in the original post).
Secondly, I do think the remark was a bit harsh. It might not be "correct" or "the best", but you put it in FileMaker and it works.
Finally, it is been sometime after my uni days, so I googled "data domain integrity principle" and as far as four words go together I did not get any matches. Is my google broken? Would you kindly point me to a correct URI? Many thanks in advance.
As far as I remember data domain refers to a set of values, e.g. Yes or No. I did not realise that you can blindly apply it to any field. Forgive me, I am not an expert, so please correct me if I am wrong. I know data domain can be enforced by data types, but I do not think it is a default and even then it relies on the set of values, some sort of enumeration.
I think you are suggesting that there is a default data integrity on any field and the entry of data you perceive as incorrect violates this integrity. Does this apply when the integrity rules were not specified/enforced by a developer?
On the other hand we do violate a bunch of general database principles on a daily basis and it does not stop us to ship the systems which then work for years. Using multi value fields to store foreign keys is a good example.
Suddenly it became a very exiting discussion.
When you add fields to the layout, there is an option to show, not show the name label.
Consider do a selection of a number of fields from the picker using shift click, etc.
Drag those onto the layout. Select the fields and make them transparent.
Set a conditonal for al of the fields to not empty and give the field a background color.
Drag them over the name fields.
The field name shows through.
Once data is entered the field gains a color and the name dissappears. If emptied, teh name shows again.
There's a problem with this that might need a trigger to resolve but since I haven't tested it I'm not sure if it will meet your requirements.
I can't see why not knowing the name of a field helps but since you asked...
Using Insert and the list of gets might give you a text variable you can insert into the field calculation.
Many thanks to everyone for their help and answers
All the best
I am trying to get produce a layout in Filemaker Pro Advanced 13 where the fields will display the field name
until data is entered. The purpose is to give a clean look to the form.
that's why field labels exist.
Here is a link to a technique that works in FMP 12 and still works in FMP 13. In FMP 13 you do have the option of using hide object when. You can also download sample files from the link. Even Cooler InLine Labels
That is a matter of opinion. I do use tooltips but I also label my fields. I don't use the Inline labels, but I don't see where it would create confusion. I believe it would be less confusing than a tool tip. You would have a layout with 25 fields with no labels, now how confusing would that be. Placement of the label is a matter of preference. Tooltips should explain in more detail what is required / expected in the field. For example you have a field labeled Full Name. What format is expected? Your Tooltip would show that. "Last Name, First Name Middle Name" or "First Name Middle Name Last Name". Label is used to describe what the field is for, Tooltip is to give more detail of what is expected to help the user enter data faster and correctly.
One thing to consider: Tooltips don't work on iOS. Which is where having inline labels is especially worth considering due to limited screen space.