Content Reference Class Methods

In this section, we discuss the Content Reference class methods. The methods are discussed in alphabetical order.

Syntax

CreateLink(LinkName, Label)

Description

Use the CreateLink method to create a link quickly to the same content reference executing the method. The link by defaults assumes the parent folder is the same as the content reference's parent.

A CReflink object is returned if there is no error.

After you create a link you must use the Save method to save it to the database.

Parameters

Field or Control

Definition

LinkName

Specify the name of the link as a string. This parameter takes 30 characters. This is considered as ID of the link. It cannot start with number, and can not have special characters and spaces.

Label

Specify the label of the link as a string. This parameter takes 30 characters.

Returns

A reference to a ContentReference link object.

Example

&CRef = &Portal.FindCRefByName("MyCRef");
&Link = &CRef.CreateLink("Link Object");
&Link.Save();

Syntax

Save()

Description

The Save method saves any changes you made to the content reference, for example, a changed description. It also performs some validation.

Using this method also saves any changes you made to PermissionValue or AttributeValue objects associated with this content reference.

Parameters

None.

Returns

A Boolean value: True if the content reference and its associated objects saved successfully, False otherwise.

Example

If NOT(&MyCRef.Save()) Then
   /* save failed, do error processing */
End-If;