APPLICATION DESIGN


Creating a profile form
A form used for profile documents is an ordinary form used in a special way.

1. Create a form with fields to hold the values you want to store in profile documents. The fields may be of any type including rich text.

2. Choose Design - Form Properties and deselect "Include in Menu" and "Include in Search Builder." Any Author can create the profile document and any Editor can edit it once it is created. If you want to allow selected Authors to edit the profile, add an Authors field just as you would for any form.

3. Save the form.

4. Do not include the form in any view. (Profile documents do not appear in views anyhow.)

5. Create a button, action, or agent that uses either the LotusScript NotesDatabase GetProfileDocument or NotesUIWorkspace EditProfile method, or the formula language @Command([EditProfileDocument]) to create or access the document. Use a Hide When formula with @UserRoles to hide the button from users you don't want editing the profile. Use the database ACL and Authors fields for further protection since Hide When formulas are not secure.

In IBM® Lotus® Notes®, you can create or edit a profile document by using @Command([EditProfileDocument]) or @SetProfileField. In Web applications, use @SetProfileField to create profile documents. Note that @Command([EditProfileDocument]) does not work on the Web.

You can use @SetProfileField and @GetProfileField to set and retrieve field values in profile documents in both Notes and Web applications.

If you prefer scripts to formulas, use LotusScript routines to create and edit profile documents. The EditProfile method of the NotesUIWorkspace class produces the same result as the @Command([EditProfileDocument]) command used in a formula.

To set or retrieve field values for a profile document with a script, use the GetProfileDocument method to access the document. You can then retrieve values from the document or set new ones, just as you would with any document.

Use the IsProfile property for the NotesDocument class to determine if a NotesDocument object is a profile document. Use the NameOfProfile property to retrieve the name of the profile document.

Note You cannot delete a profile document using an @command or @function. Use LotusScript if you must delete a profile document.

See Also