Favorite Collection Methods

In this section, we discuss the Favorite collection methods. The methods are discussed in alphabetical order.

Syntax

DeleteItem(FavoriteLabel)

Description

The DeleteItem method deletes the Favorite object identified by FavoriteLabel from the Favorite Collection.

Note: The portal registry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.

Parameters

Field or Control

Definition

FavoriteLabel

Specify the label of a Favorite existing in the Favorite collection, that is, the text used to identify the favorite to the end-user.

Returns

A Boolean value: True if the Favorite was deleted, False otherwise.

Example

If Not &MyColl.DeleteItem("My Local Test") Then
   /* can't delete test data. Do error processing */
End-if;

Syntax

First()

Description

The First method returns the first Favorite object in the Favorite collection.

Parameters

None.

Returns

A Favorite object.

Example

&MyFav = &MyCollection.First();

Syntax

InsertFolderItem(FavoriteLabel, FavoriteName)

Description

Use the InsertFolderItem method to insert the Favorite folder object identified by FavoriteName into the Favorite collection.

Note: The portal registry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted to the database as soon as the method is executed.

Parameters

Field or Control

Definition

FavoriteLabel

Specify a label for the new Favorite folder as a string. This is the text by which the favorite is identified to the end user.

FavoriteName

Specify the name for the new Favorite folder as a string. If you specify a name that already exists in the collection, you get an error.

Returns

A reference to the new Favorite object if the method executes successfully, Null otherwise.

Syntax

InsertItem(FavoriteLabel, FavoriteName)

Description

The InsertItem method inserts the Favorite object identified by FavoriteName into the Favorite Collection.

Note: The portal registry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted to the database as soon as the method is executed.

Parameters

Field or Control

Definition

FavoriteLabel

Specify a label for the new Favorite. This is the text by which the favorite is identified to the end-user.

FavoriteName

Specify the name of a new Favorite. This parameter takes a string value. If you specify a name that already exists in the collection, you get an error.

Returns

A reference to the new Favorite object if the method executed successfully, NULL otherwise.

Syntax

ItemByLabel(FavoriteLabel)

Description

The ItemByLabel method returns the Favorite object with the label FavoriteLabel. The label is the text used to identify the favorite to the end-user.

Parameters

Field or Control

Definition

FavoriteLabel

Specify the label of an existing Favorite within the Favorite collection. If you specify an invalid favorite, the object returned is Null.

Returns

A Favorite object if successful, Null otherwise.

Example

&MyFavorite = &MyColl.ItemByLabel("My Local Login");

Syntax

Next()

Description

The Next method returns the next Favorite object in the Favorite collection. You can use this method only after you have used the First method: otherwise the system doesn’t know where to start.

Parameters

None.

Returns

A Favorite object.

Example

&MyFavorite = &MyCollection.Next();

Syntax

Save()

Description

Use the Save method to save any changes you made to the Favorite collection.

Parameters

None.

Returns

A Boolean value: True, the collection saved successfully, False otherwise.