@SetProfileField (Formula Language)

Sets the value of a field in a profile document or creates a profile document.

Syntax

@SetProfileField( profilename ; fieldname ; value ; uniqueKey )

Parameters

profilename

Text. The name of the profile document that contains the field you want to access. If no profile document exists by this name, Notes/Domino creates one.

fieldname

Text. The name of the field you want to access.

value

Text, number, time-date, time-date range, or list thereof. The value to which you want to set the field.

uniqueKey

Text. Optional. A unique key that identifies the profile document.

Return value

value

The value to which you set the field.

Usage

Use this function to create a profile document in a Web application. The EditProfile @command does not work on the Web. If no document exists with the name specified as the first parameter of this function, Notes/Domino creates a profile document with that name. Use @GetProfileField to access data from the profile document.

The value can be anything and does not have to match the type of the field as defined on a form. This function does not reset flags on an existing field and does not set flags for a newly stored field. For example, a Readers field does not become plain text by assigning a text value; and a newly stored field cannot be made a Readers field. The LotusScript® and Java classes allow this manipulation through NotesItem and Item.

Examples

  1. This example sets the contents of the "Profile Categories" field of the "Interest Profile" document to the name of the current platform.
    @SetProfileField("Interest Profile";
    "ProfileCategories"; @Platform) 
  2. This example sets the contents of the "Profile Categories" field of the "Interest Profile" document for the current user to the name of the current platform.
    @SetProfileField("Interest Profile"; 
    "ProfileCategories"; @Platform; @UserName) 
  3. This code, when added to the Set Profile Field action button in a Web application, creates a profile document called webProfile, creates a fname field and sets the value of the fname field on the profile document equal to the value of the fname field on the current document.
    @SetProfileField("webProfile";"fname";fname)