The Salesforce Experience Cloud allows you to create public/private customer and partner communities for different use cases like public customer service portal, public knowledge base, running your business with an e-commerce site, etc. Salesforce allows you to run your production community with a branded domain that suits your business like www.universalcoffee.com, www.hikingbikes.com, etc. But this feature was never available in sandboxes. Since Spring’21, Salesforce has allowed custom domains in sandboxes. Now you can run your Salesforce Community under a custom domain in a sandbox as well. Earlier, this was limited to only production environments.
What is a Custom Domain?
Custom Domains are the URLs that you can create for your communities. It is a way to have your own Salesforce org customized URL rather than a common Salesforce URL. By registering a custom domain, you can highlight your brand and make your salesforce org more secure and robust.
What is the Benefit of Custom Domain in Sandboxes?
Custome Domain in Sandboxes is an excellent feature as it helps assess all the developments now in the sandbox and not get any surprises in production. Earlier, the development team used to perform all the domain setup steps directly in production and could not avoid any unknown issues. This way, you can have a test version of the branded URL for your sandboxes and perform all the testing of your domains with the network/domain team. As a start, you can refer to the below Salesforce documents to understand the details:
2. https://help.salesforce.com/articleView?id=sf.domain_mgmt_overview.htm&type=5
Steps to Implement Custom Domains in Sandbox
Follow the below steps to create a branded domain in your sandbox:
- You need to have the custom domain to map to the sandbox community, e.g., test.myCompany.com (further referred to as custom domain).
- In your production org, go to setup->domain management->domains->add domain. You will get a screen similar to fig 1. You need to have a CA-signed certificate to fill in all the details. Generate a CSR request from setup->certificate and key management and send it to your signing authority. They will send back the signed certificate, which you have to upload again to the same CSR request.
3. Create a CNAME record to point your custom domain to the following Salesforce domain: [custom domain].[production org id].live.siteforce.com. This will be done by your network team or domain management team. Once they complete this task, you should return to the Add Domain screen and fill in the details. You can also do this step earlier; it depends on your choice.
4. Fill custom domain in the Domain Name field. In this case test.myCompany.com
5. In the HTTPS Option field, choose the first option and select the signed certificate from the lookup.
6. In the Associated Org field (this field will appear in production from Spring’21), the default value selected is production. Still, when you click on the picklist, all the related sandboxes will be listed, so select the sandbox as per your requirement. In case, list of sandboxes doesn’t appear, contact Salesforce support.
7. Save the changes.
8. After Save, you may see PRODUCTION in the Associated Org field on the details page. Do not panic. Just hit Activate to provision and activate your custom domain.
9. After it is activated, you will see your sandbox name again in the Associated Org field.
10. Until this point, if you have done all the steps perfectly, you are almost there to finish all the changes and publish your sandbox community custom domain.
11. Now, login to the sandbox you selected in the Associated Org field.
12. Go to Setup->Domain Management->Custom URLs->New Custom URL. You will see a screen like Fig 2.
13. Select your custom domain in the Domain lookup on the Custom URL screen.
14. Optional: specify a path in the Path field.
15. Select your Salesforce Site or Experience Cloud site in the Sites lookup.
16. Save the changes.
17. Wait for a few mins as all the changes will synchronize on the Salesforce server before your sandbox community custom domain starts to work.
18. After a few minutes, try to open your custom domain on the browser, and it should work, i.e., open test.myCompany.com on the browser, and you must be seeing your community.
To Sum Up
Custom Domains in sandboxes allow you to safely set up a branded domain in the sandbox to avoid any issues in production. This way, all the processes can be easily replicated during production domain setup in coordination with the network/domain team. You can always suggest your customers set up a custom domain in sandboxes before production setup.
Leverage the saasguru platform for a successful Salesforce career. Get successfully certified on Salesforce in the first go in as little as two weeks. If you have any comments on the topic, please leave a comment. Our team of gurus will assist you with any further clarifications.