APPLICATION DESIGN
A window title can be static -- that is, it always displays the same message -- or dynamic -- that is, it displays a message that changes based on a formula you create. An example of a dynamic window title is a title for a main document in a discussion database that includes the number of responses to the document. The title changes each time a new response gets created.
To create a window title, write a formula that supplies the text to display. The text can be a text string you enter directly, text that results from a function, or the contents of any field type except rich text or rich text lite. If the field does not contain text or if a function does not return text, you must convert the value to text using the @Text function. For example, the following formula converts the date value in the DateCreated field to a text value for display in the window title:
"Response created on " + @Text(DateCreated);
To customize a form's window title
1. Open the form.
2. On the Object tab in the Programmer's pane, select Window Title - attribute.
3. Enter text enclosed in quotation marks or a formula that evaluates to text.
4. Click the green check mark to save the formula.
5. To test the window title, create, save, and read a new document. Make sure the title is appropriate for all three situations.
Examples: Customizing window titles
Title includes creation date and company name This formula displays the date the document was created, form name, and company that was billed. @Text converts the date to a text string, and the extra spaces within the quotation marks force the words in the title to be properly spaced.
@Text(@created) + " Inventory Invoice for " + CompanyName
This formula uses the field "form" to refer to the form name instead of hard coding it into the formula.
@Text(@created) + " " + form + " for " + Company Name
Title includes number of responses This formula is useful for a main document form in a discussion database.
@If(@IsNewDoc;"New Topic";Subject + @DocDescendants(" (No Responses)";" (1 Response)";" (% Responses)));
If the document has never been saved, New Topic shows in the title bar while the user composes the document. After the document is saved, the title is the subject combined with the number of responses. If the subject is Icebox 2000 and there are no responses, the title of the document is Icebox 2000 (No Responses). With one response, the title becomes Icebox 2000 (1 Response). With two responses, the title becomes Icebox 2000 (2 Responses).
Response includes the subject When the response or response-to-response is first composed, this formula displays New Response To and the subject of the main document.
@If(@IsNewDoc;"New Response to " + Subject; "Response " + @DocNumber("") + " of " + @DocSiblings + " to " + Subject);
When a user reads the response, the window title displays the total number of responses to the main document, the response being displayed, and the subject of the main document. For example, if the response document is the second of four responses to Icebox 2000, the title displays as Response 2 of 4 to Icebox 2000.
See Also