Creating, Modifying, and Troubleshooting Profile Documents

A profile document is a special type of document that is similar in most ways to a standard document, but there are a few key differences. First, a profile document does not display in views, nor is it included in a document count of a database. Additionally, a profile document is cached in memory while the database that contains it is open, meaning that the document can be accessed very quickly, making it handy for temporary storage.

Each Domino database can have one or more profile documents that match a key used to retrieve them. The number of profile documents used in an application is completely dependent on your design requirements.

As a developer, you enable users to create and access profile documents by scripting buttons or agents with LotusScript or formulas that read and write values from the profile documents.

Users must have at least Author access in the ACL to create a profile document that is available to all users.


Creating a Profile Document

Creating a profile document is fairly simple. Just follow these steps:

Only one profile document per form can exist for each user of a database. Alternatively, only one profile document can exist for a database if that form is available to all users.


1.
Open the database that will contain the profile document.

2.
In the Design Pane, click Forms to see the list of existing forms.

3.
Click New Form to create a new form.

4.
Add fields to the form that will hold the values you wish to store.

5.
From the menu, choose Design, Form Properties. This opens the Form properties box. Alternatively, right-click the form and choose Form Properties. On the Form Info tab (the first tab), deselect Include in Menu.

6.
Save the form.

7.
Create a button, action, or agent that uses @Command([EditProfileDocument]) to create or access the document.

In Notes client applications, you can create or edit profile documents by using either the @SetProfileField function or the @Command([EditProfileDocument]) command. For Web applications, you must use @SetProfileField to create profile documents because @Command([EditProfileDocument]) does not work on the Web.

Modifying a Profile Document

Once you have created a profile document, you can use the @GetProfileField and @SetProfileField functions to access the contents of the profile document. Each function is explained in the following sections.

You cannot delete a profile document using an @Command or @Function. Use LotusScript if you must delete a profile document.


Using @GetProfileField to Read Values from a Profile Document

To read values stored in a profile document, you can use the @GetProfileField function, which will return the contents of a specified field. Its syntax is as follows:

@GetProfileField( profilename ; fieldname; uniqueKey )

The first parameter, profilename, is a required text value that specifies the name of the profile document you wish to read.

The second parameter, fieldname, is a required text value that specifies the name of the field in the document you wish to read.

The third parameter, uniqueKey, is an optional text value that specifies a unique key that identifies the profile document.

Although you cannot use the @GetProfileField function in column, hide-when, section editor, and view selection formulas, you can use it in toolbar buttons, agents, and Web-based applications.


Using @SetProfileField to Write Values to a Profile Document

To write values to a profile document, or to create a new profile document, use the @SetProfileField function. Its syntax is as follows:

@SetProfileField( profilename ; fieldname; value; uniqueKey )

The first parameter, profilename, is a required text value that specifies the name of the profile document you wish to update.

The second parameter, fieldname, is a required text value that specifies the name of the field in the document you wish to update.

The third parameter, value, is a required text value that will be written to the field.

The fourth parameter, uniqueKey, is an optional text value that specifies a unique key that identifies the profile document.

Remember that if the profile document specified in the first parameter does not exist, the @SetProfileField function will create it.


Troubleshooting Profile Documents

The following list contains some of the most common problems encountered when using profile documents and their resolution:

  • A user creates a profile document, but it is not accessible to other users. Ensure that the user creating the profile document has at least Author access in the ACL.

  • Users cannot access a profile document. Ensure the proper profile name or proper key is specified.

  • The @GetProfileField function does not return the expected values. Ensure the correct field name is specified.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.93.137