As with the previous part, we create and format text in Layout mode, and move the text on top of the field. We will do this for the company and phone number fields. As a visual cue, we will use a different colour for these optional field cues.
Next we apply conditional formatting. Select the text object and choose the Format > Conditional... command (or right-click and select Conditional Formatting... from the contextual menu). Add a condition and specify the calculation:
not ( IsEmpty(Contact Management::Company)
and Get(RecordOpenState) = 1 )
The field specified will be the field you are creating the text cue for.
What we are saying here is that the formatting of this text will change when the condition is true – when the field is not empty and record does not have an open state of 1.
So what is "an open state of 1"? A record has an open state of 1 when it is a new record that hasn't been committed. A closed or committed record has an open state of 0; a modified record that hasn't been committed has an open state of 2.
Click OK. Set the Format for the condition you have created. Set the text colour to white. Click the More Formatting... button and set the size to 1 Point. Click OK twice to close and save the conditional formatting.
Now test it! In Browse mode, create a new record and notice that the label is visible over the field. Tab into the field and enter some data. When you tab out, the label will be gone.
Now test it with another new record. This time do not enter any text into the field. When you commit the record, the text still disappears. This is the behaviour we wanted - the text cues should only be visible when entering data in a new record.
Here is a quick video of how it should work for each of the tests above:
It is also possible to have the text cues re-appear for optional entry fields when the record is being edited but only if those fields are still empty. The cues have to be triggered so the solution involves use of the Evaluate function. I will leave the rest to you If you can't work it out, email me a request to post it here.

not ( IsEmpty(Contact Management::Company)
and Get(RecordOpenState) = 1 )
The field specified will be the field you are creating the text cue for.

So what is "an open state of 1"? A record has an open state of 1 when it is a new record that hasn't been committed. A closed or committed record has an open state of 0; a modified record that hasn't been committed has an open state of 2.
Click OK. Set the Format for the condition you have created. Set the text colour to white. Click the More Formatting... button and set the size to 1 Point. Click OK twice to close and save the conditional formatting.
Now test it! In Browse mode, create a new record and notice that the label is visible over the field. Tab into the field and enter some data. When you tab out, the label will be gone.
Now test it with another new record. This time do not enter any text into the field. When you commit the record, the text still disappears. This is the behaviour we wanted - the text cues should only be visible when entering data in a new record.
Here is a quick video of how it should work for each of the tests above:
It is also possible to have the text cues re-appear for optional entry fields when the record is being edited but only if those fields are still empty. The cues have to be triggered so the solution involves use of the Evaluate function. I will leave the rest to you If you can't work it out, email me a request to post it here.
No comments:
Post a Comment