AssignedSections Collection Methods

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

Syntax

DeleteItem(SectionName)

Description

The DeleteItem method deletes the AssignedSection object identified by SectionName from the AssignedSections Collection.

This method is not executed automatically. It is executed only when the parent object is saved.

Parameters

Parameter

Description

SectionName

Specify the name of an AssignedSection existing in the AssignedSections collection.

Returns

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

Example

Local boolean &ret = &sectionCollection.DeleteItem("SECTIONA");

Syntax

First()

Description

The First method returns the first AssignedSection object in the AssignedSections collection.

Parameters

None.

Returns

An AssignedSection object.

Example

&thisSection = &sectionCollection.First();

Syntax

InsertItem(SectionName,Column,Order,LayoutBehavior)

Description

The InsertItem method creates and inserts an AssignedSection object identified by the given parameters into the AssignedSections Collection.

Parameters

Parameter

Description

SectionName

Specify a unique name of the section that you want to insert.

Column

Always pass zero as the value.

The system automatically saves this section to have a column number set to zero.

Order

The order number of the AssignedSection on a fluid homepage or dashboard.

LayoutBehavior

Specify whether the user can change when and how the section displays. This property takes a string value. The values are:

Value

Description

4OPT

Similar behavior as 3DEF.

3DEF

This section displays to the user by default. If personalization is enabled, the user can remove or reposition this section.

2REQ

This section is required.

The user cannot remove this section. However, they are allowed to reposition the section if personalization is enabled.

1FIX

The user cannot remove this section or change its position on the homepage or dashboard.

Returns

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

Example

The following code inserts a new section (SECTIONA) as the first section on the homepage with the layout settings as 3DEF.

&thisSection = &sectionCollection.InsertItem("SECTIONA", 0, 1, "3DEF");

Syntax

ItemByName(Name)

Description

The ItemByName method returns the AssignedSection object identified as Name from the AssignedSections collection.

Parameters

Parameter

Description

Name

Specify the name of an existing AssignedSection within the AssignedSections collection.

Returns

An AssignedSection object if successful, NULL otherwise.

Example

&thisSection = &sectionCollection.ItemByName("SECTIONA");

Syntax

Next()

Description

The Next method returns the next AssignedSection object in the AssignedSections 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

An AssignedSection object.

Example

&thisSection = &sectionCollection.Next();