CreateLink method: Content Reference class

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

Parameter Description

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();