FindCRefByName method: PortalRegistry class

Syntax

FindCRefByName(Name)

Description

The FindCRefByName method returns the content reference object corresponding to Name. The name is a unique identifier for each content reference.

Parameters

Parameter Description

Name

A unique name within the registry that identifies the content reference. This parameter takes a string value. This parameter uses the name, not the label, of a content reference.

Returns

What this method returns depends on the condition of the content reference:

  • If the content reference name is valid and the end-user has access to the content reference, a content reference object is returned.

  • If the content reference is valid but the end-user doesn't have access to it a content reference object is returned, however, the only property you can access is the Authorized property.

  • If you specified an invalid name this method returns NULL.

Example

The following example returns a GLOBAL_PAYROLL content reference object:

&CRef = &Portal.FindCRefByName("GLOBAL_PAYROLL");

Considerations on Returned Content References

This method returns content reference objects that aren't yet valid as well as ones that are no longer valid. When you create your program, you must check for these invalid values if you don't want to use them. You can check using ValidTo, ValidFrom, or IsVisible.

This method returns content reference objects that you aren't authorized to. When you create your program, you should always check the Authorized property. This is the only property you can view from an object that you're not authorized to view.

Related Topics