Attribute Collection Methods
In this section, we discuss the Attribute collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteItem(AttributeValueName)
Description
The DeleteItem method deletes the AttributeValue object identified by AttributeValueName from the Attribute Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
Field or Control |
Definition |
---|---|
AttributeValueName |
Specify the name of an AttributeValue existing in the Attribute Collection. |
Returns
A Boolean value: True if the AttributeValue was deleted, False otherwise.
Syntax
First()
Description
The First method returns the first AttributeValue object in the Attribute Collection.
Parameters
None.
Returns
An AttributeValue object.
Example
&MyAttributeValue = &MyCollection.First();
Syntax
InsertItem(AttributeValueName)
Description
The InsertItem method inserts the AttributeValue object identified by AttributeValueName from the Attribute Collection.
This method is not executed automatically. It is executed only when the parent object is saved.
Parameters
Field or Control |
Definition |
---|---|
AttributeValueName |
Specify the name of an AttributeValue existing in the Attribute Collection. |
Returns
A reference to the new AttributeValue object if the method executed successfully, NULL otherwise.
Example
For &I = 1 To &Rowset.ActiveRowCount
If &CompName = "PORTAL_CREF_ADM" Then
&Record = &Rowset.GetRow(&I).GetRecord(Record.PORTAL_CATR_DV);
Else
&Record = &Rowset.GetRow(&I).GetRecord(Record.PORTAL_FATR_DV);
End-If;
If &Record.PORTAL_ATTR_NAM.Value <> "" Then
&Attr = &AttrColl.InsertItem(&Record.PORTAL_ATTR_NAM.Value);
&Attr.Value = &Record.PORTAL_ATTR_VAL.Value;
End-If;
End-For;
Syntax
ItemByName(Name)
Description
The ItemByName method returns the AttributeValue object with the name Name.
Parameters
Field or Control |
Definition |
---|---|
Name |
Specify the name of an existing AttributeValue within the Attribute Collection. If you specify an invalid name, the object is NULL. |
Returns
An AttributeValue object if successful, NULL otherwise.
Example
&Attr = &AttrColl.ItembyName("RELLINK");
Syntax
Next()
Description
The Next method returns the next AttributeValue object in the Attribute 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
AttributeValue object.
Example
&MyAttributeValue = &MyCollection.Next();