Newer Version Available

This content describes an older version of this product. View Latest

Network Class

Represents a community.

Namespace

System

Usage

Use the method in the Network class to determine which community a user is currently logged into.

Network Constructors

The following are constructors for Network.

Network()

Creates a new instance of the System.Network class.

Signature

public Network()

Network Methods

The following are methods for Network. All are instance methods.

getNetworkId()

Returns the user’s current community.

Signature

public String getNetworkId()

Return Value

Type: String

Usage

If Communities isn’t enabled for the user’s organization or the user is currently in the internal organization, returns null.

communitiesLanding()

Returns a Page Reference to the default landing page for the community. This is the first tab of the community.

Signature

public String communitiesLanding()

Return Value

Type: PageReference

Usage

If Communities isn’t enabled for the user’s organization or the user is currently in the internal organization, returns null.

forwardToAuthPage(String StartURL)

Returns a Page Reference to the default login page. StartURL is included as a query paremeter for where to redirect after a successful login.

Signature

public PageReference forwardToAuthPage(String startURL)

Parameters

startURL
Type: String

Return Value

Type: PageReference

Usage

If Communities isn’t enabled for the user’s organization or the user is currently in the internal organization, returns null.