List Class Methods

In this section, the List class methods are presented in alphabetical order.

Syntax

createInstance(instance_ID, title, &context_data)

Description

Use this method to create an activity guide instance by cloning the current activity guide template including its action items, participants, and so on.

Parameters

Field or Control

Definition

instance_ID

Specifies the ID for the activity guide instance as a string.

title

Specifies the title for the activity guide instance as a string.

Note: The title is also referred to as the Label property.

&context_data

Specifies the contextual data for the activity guide instance as a PTAI_COLLECTION:Collection object.

Returns

A List object.

Example

This is a code example of the CreateInstance method:

method CreateInstFromCtxtData
   /+ &oCtxt as PTAI_COLLECTION:Collection +/
   /+ Returns String +/
   Local PTAI_ACTION_ITEMS:ContextData &ctxData;
   Local PTAI_ACTION_ITEMS:List &newList = create PTAI_ACTION_ITEMS:List();
   Local PTAI_COLLECTION:Collection &ctxDataColl = create PTAI_COLLECTION:Collection();
   Local integer &i, &nbr;
   Local string &label, &descr, &InstanceId;
   try
      For &i = 1 To &oCtxt.Count
         &ctxData = (&oCtxt.Item(&i) As PTAI_ACTION_ITEMS:ContextData);
         If &ctxData.ctxKey And
               &ctxData.keyValue = "" Then
            Return "";
         End-If;
         &ctxDataColl.InsertItem(&ctxData);
      End-For;
      
      &newList.open(&Template_Id);
      SQLExec(SQL.PTAI_GET_INSTANCES, &newList.ListId, &nbr);
      &nbr = &nbr + 1;
      &label = &newList.Label | "-" | &nbr;
      &InstanceId = &newList.createInstance(&label, &newList.DescrLong, &ctxDataColl).ListId;
      Return &InstanceId;
   catch Exception &e
      Return "";
   end-try;
   
end-method;

Syntax

getActionItems()

Description

Use this method to return an array of all action item IDs for the current activity guide. This method returns IDs for both summary and detail action items.

Parameters

None.

Returns

An array of string.

Syntax

GetContext()

Description

Use this method to get the contextual data for the current activity guide.

Parameters

None.

Returns

A PTAI_COLLECTION:Collection object.

Syntax

getMembers()

Description

Use this method to return a PTAI_COLLECTION:Collection object representing participants for the current activity guide.

Parameters

None.

Returns

A PTAI_COLLECTION:Collection object.

Syntax

GetPgltBtn()

Description

Use this method to return a PTAI_COLLECTION:Collection representing the definitions for custom navigation frame buttons for the current activity guide.

Parameters

None.

Returns

A PTAI_COLLECTION:Collection object.

Syntax

getRootItems()

Description

Use this method to return an array of action item IDs for summary action items for the current activity guide.

Note: This method does not return IDs for detail action items.

Parameters

None.

Returns

An array of string.

Syntax

new(ID, portal, title)

Description

Use this method to generate a new activity guide.

Parameters

Field or Control

Definition

ID

Specifies the ID for the new activity guide as a string.

portal

Specifies a portal for the activity guide as a string.

title

Specifies the title for the activity guide as a string.

Note: The title is also referred to as the Label property.

Returns

None.

Syntax

open(ID)

Description

Use this method to retrieve an activity guide definition from the database and sets all the properties.

Parameters

Field or Control

Definition

ID

Specifies the activity guide ID as a string.

Returns

None.

Syntax

save()

Description

Use this method to save the current activity guide definition to the database. If this is a new activity guide, then the definition is inserted into the database; otherwise, an existing definition is updated in the database.

Parameters

None.

Returns

A Boolean value: True if the save is successful, False otherwise.

Syntax

SaveContext(&context_data)

Description

Use this method to save the contextual data for the current activity guide to the database. Any existing contextual data for this activity guide definition is deleted from the database first.

Parameters

Field or Control

Definition

&context_data

Specifies the contextual data for the activity guide as a PTAI_COLLECTION:Collection object.

Returns

None.

Syntax

saveMembers(&members)

Description

Use this method to save the participants (members) for the current activity guide to the database. Any existing participants for this activity guide definition are deleted from the database first.

Parameters

Field or Control

Definition

&members

Specifies the participants for the activity guide as a PTAI_COLLECTION:Collection object.

Returns

None.

Syntax

SavePgltBtn(&pgltBtns)

Description

Use this method to save the definitions for the custom navigation frame buttons for the current activity guide to the database. Any existing custom button definitions for this activity guide are deleted from the database first.

Parameters

Field or Control

Definition

&pgltBtns

Specifies the custom navigation frame buttons for the activity guide as a PTAI_COLLECTION:Collection object.

Returns

A PTAI_COLLECTION:Collection object.