function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CarlBCarlB 

CustomSite metadata

Hello.

I'm trying to figure out how I can find out the URL for a particular page hosted in a Salesforce Site, using the metadata API.

I know that the url should be something like "https://AAA-BBB.CCC.force.com/DDD/Page_Name, where AAA is the sandbox name, BBB is the site name, CCC is the Salesforce host and DDD is the site path.

I have obtained the CustomSite metadata for the Site.  According to the documentation, the getSubdomain() method should give me "AAA-BBB.CCC.force.com".  However, instead it just gives me "BBB".

Is the documentation wrong?  If so, how do I generate the full URL for the page?
BugudeBugude
Salesforce documents can be confusing sometimes!
Complete domain will be combination of the domain url and subdomain. 
For example, if the test.salesforce.com, the subdomain will be "test" and the domain URL will be salesforce.com.


PS: if this answers your question then hit Like and mark it as solution/best answer
CarlBCarlB
Hello.

So where do I get the domain URL from?

Regards,

Carl
BugudeBugude
Try using System class for getting any details about URL either Domain or Original URL. Check below Salesforce Site Class link.

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_sites.htm

PS: if this answers your question then hit Like and mark it as solution/best answer
CarlBCarlB
Hi.

Will that work from a Java client accessing the org using the metadata API?

Regards,

Carl