DomainCreator Class
Namespace
Examples
This example code fetches the org’s My Domain login hostname and the Visualforce hostname for the uat package.
1//Get the My Domain login hostname
2String myDomainHostname = DomainCreator.getOrgMyDomainHostname();
3
4//Get the Visualforce hostname
5String 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.
1//Get the org’s Lightning hostname
2String myLightningHostname = DomainCreator.getLightningHostname();
3
4//Get the ID of a record Account with the name ‘Acme’
5Account acct = [SELECT Id FROM Account WHERE Name = 'Acme' LIMIT 1];
6
7//Build the URL to view the account record
8String 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