Network Class
Manage Experience Cloud sites.
-
Create an instance of the
System.Networkclass. -
Get the default landing page, login page, and self-registration page of a site. Asynchronously create site users and records. Get the login and logout URLs for a site. Get a user’s current site. Map dashboards and Insights reports.
Create an instance of the System.Network class.
The following are constructors for Network.
-
Creates a new instance of the
System.Networkclass.
Creates a new instance of the System.Network class.
public Network()
Get the default landing page, login page, and self-registration page of a site. Asynchronously create site users and records. Get the login and logout URLs for a site. Get a user’s current site. Map dashboards and Insights reports.
The following are methods for Network. All methods are static.
-
Returns a Page Reference to the default landing page for the Experience Cloud site. This is the first tab of the site.
-
createExternalUserAsync(user, contact, account)
Asynchronously creates an Experience Cloud site user for the given account or contact and associates it with the site. This method processes requests in batches and then sends an email with login information to the user.
-
createRecordAsync(processType, mbObject)
Asynchronously creates case, lead, and custom object records. This method collects record creation requests and processes them in batches.
-
Returns a Page Reference to the default login page. StartURL is included as a query paremeter for where to redirect after a successful login.
-
Returns the absolute URL of the login page used by the Experience Cloud site.
-
Returns the absolute URL of the logout page used by the Experience Cloud site.
-
Returns the user’s current Experience Cloud site.
-
Returns the absolute URL of the self-registration page used by the Experience Cloud site.
-
loadAllPackageDefaultNetworkDashboardSettings()
Maps the dashboards from the Salesforce Communities Management package onto each Experience Cloud site’s unconfigured dashboard settings. Returns the number of settings it configures.
-
loadAllPackageDefaultNetworkPulseSettings()
Maps the Insights reports from the Salesforce Communities Management package onto each Experience Cloud site’s unconfigured Insights settings. Returns the number of settings it configures.
Returns a Page Reference to the default landing page for the Experience Cloud site. This is the first tab of the site.
public static String communitiesLanding()
Type: PageReference
If digital experiences isn’t enabled for the user’s org or the user is currently in the internal org, returns null.
Asynchronously creates an Experience Cloud site user for the given account or contact and associates it with the site. This method processes requests in batches and then sends an email with login information to the user.
public static String createExternalUserAsync(SObject user, SObject contact, SObject account)
- user: Type: SObject (optional) Information required to create a user.
- contact: Type: SObject (optional) The contact you want to associate the user with.
- account: Type: SObject The account you want to associate the user with.
Type: String
Returns the UUID for the site user.
Asynchronously creates case, lead, and custom object records. This method collects record creation requests and processes them in batches.
public static String createRecordAsync(String processType, SObject mbObject)
- processType: Type: String The process you use to create records.
- mbObject: Type: SObject The records created for objects. Objects must be supported by the high-volume record creation.
Type: String
Returns the UUID for the record created.
Returns a Page Reference to the default login page. StartURL is included as a query paremeter for where to redirect after a successful login.
public static PageReference forwardToAuthPage(String startURL)
- startURL: Type: String
Type: PageReference
If digital experiences isn’t enabled for the user’s org or the user is currently in the internal org, returns null.
Returns the absolute URL of the login page used by the Experience Cloud site.
public static String getLoginUrl(String networkId)
- networkId: Type: String The ID of the Experience Cloud site you’re retrieving this information for.
Type: String
Returns the full URL for the Lightning Platform or Experience Builder page used as the login page in the Experience Cloud site.
Returns the absolute URL of the logout page used by the Experience Cloud site.
public static String getLogoutUrl(String networkId)
- networkId: Type: String The ID of the Experience Cloud site you’re retrieving this information for.
Type: String
Returns the full URL for the Lightning Platform page, Experience Builder page, or Web page used as the logout page in the Experience Cloud site.
Returns the user’s current Experience Cloud site.
public static String getNetworkId()
Type: String
If digital experiences isn’t enabled for the user’s org or the user is currently in the internal org, returns null.
Returns the absolute URL of the self-registration page used by the Experience Cloud site.
public static String getSelfRegUrl(String networkId)
- networkId: Type: String The ID of the Experience Cloud site you’re retrieving this information for.
Type: String
Returns the full URL for the Lightning Platform or Experience Builder page used as the self-registration page in the Experience Cloud site.
Maps the dashboards from the Salesforce Communities Management package onto each Experience Cloud site’s unconfigured dashboard settings. Returns the number of settings it configures.
public static Integer loadAllPackageDefaultNetworkDashboardSettings()
Type: Integer
If digital experiences is enabled, and the Salesforce Communities Management package is installed, maps the dashboards provided in the package onto each Experience Cloud site’s unconfigured dashboard settings. Returns the number of settings it configures. This method is invoked automatically during site creation and package installation, but isn’t typically invoked manually.
If digital experiences isn’t enabled for the user’s org or the user is in the internal org, returns 0.
Maps the Insights reports from the Salesforce Communities Management package onto each Experience Cloud site’s unconfigured Insights settings. Returns the number of settings it configures.
public static Integer loadAllPackageDefaultNetworkPulseSettings()
Type: Integer
If digital experiences is enabled, and the Salesforce Communities Management package is installed, maps the Insights reports provided in the package onto each Experience Cloud site’s unconfigured Insights settings. Returns the number of settings it configures. This method is invoked automatically during site creation and package installation, but isn’t typically invoked manually.
If digital experiences isn’t enabled for the user’s org or the user is in the internal org, returns 0.