DomainCreator Class
Namespace
Examples
This example code fetches the org’s My Domain login hostname and the Visualforce hostname for the uat package.
//Get the My Domain login hostname
String myDomainHostname = DomainCreator.getOrgMyDomainHostname();
//Get the Visualforce hostname
String vfHostname = DomainCreator.getVisualforceHostname('uat');
In this case, in a production org with a My Domain name of mycompany, myDomainHostname returns mycompany.my.salesforce.com. And in the same production org, vfHostname returns mycompany--uat.vf.force.com.
//Get the org’s Lightning hostname
String myLightningHostname = DomainCreator.getLightningHostname();
//Get the ID of a record Account with the name ‘Acme’
Account acct = [SELECT Id FROM Account WHERE Name = 'Acme' LIMIT 1];
//Build the URL to view the account record
String fullRecordURL = 'https://' + myLightningHostname + '/lightning/r/Account/' + acct.Id + '/view';
DomainCreator Methods
The following are methods for DomainCreator.
getExperienceCloudSitesBuilderHostname()
Signature
public static String getExperienceCloudSitesBuilderHostname()
Return Value
Type: String
getExperienceCloudSitesHostname()
Signature
public static String getExperienceCloudSitesHostname()
Return Value
Type: String
getExperienceCloudSitesLivePreviewHostname()
Signature
public static String getExperienceCloudSitesLivePreviewHostname()
Return Value
Type: String
getExperienceCloudSitesPreviewHostname()
Signature
public static String getExperienceCloudSitesPreviewHostname()
Return Value
Type: String
getLightningContainerComponentHostname(packageName)
Signature
public static String getLightningContainerComponentHostname(String packageName)
Parameters
- packageName
- Type: String
- The package name for this component.
If packageName is null, this method uses the org’s namespace prefix as the package name. Otherwise, it uses the default namespace.
Return Value
Type: String
getLightningHostname()
Signature
public static String getLightningHostname()
Return Value
Type: String
getOrgMyDomainHostname()
Signature
public static String getOrgMyDomainHostname()
Return Value
Type: String
getSalesforceSitesHostname()
Signature
public static String getSalesforceSitesHostname()
Return Value
Type: String
getVisualforceHostname(packageName)
Signature
public static String getVisualforceHostname(String packageName)
Parameters
- packageName
- Type: String
- The package name for this component.
If packageName is null, this method uses the org’s namespace prefix as the package name. Otherwise, it uses the default namespace.
Return Value
Type: String