IUserEmails.Add

Syntax

Add(Name: String; Email: String): IUserEmail;

Parameters

Name. Name of the created record.

Email. Value of the address.

Description

The Add method adds a record about the user email to the collection and returns its parameters.

Comments

The name of the record must be unique. If on executing the value of the Name parameter the name of the existing record is specified then the exception is generated.

Example

Sub UserProc;
Var
    Mb: IMetabase;
    User: IMetabaseUser;
    Prof: IUserProfile;
    Email: IUserEmail;
Begin
    Mb := MetabaseClass.Active;
    User := Mb.LogonSession.User;
    Prof := User.Profile.Edit;
    Email := Prof.Emails.Add("Default""user_mail@example.ru");
    Email.SetDefault;
    Prof.Apply;
End Sub UserProc;

On executing the example the profile of the user who logged in the repository is changed. The record with the email address will be added to the profile. This address will be set as the default for the user.

See also:

IUserEmails