You need to sign in to do that
Don't have an account?
How to obtain the Force.com Sites domain (docs are wrong?)
Hello. I have a Force.com Site domain configured, and a Force.com site. The Force.com Site domain shows under Domains > My Domains. I can query the Site object, and it has the proper SubDomain value.
According to the docs, I should be able to query the Domain object and find this Force.com Sites domain. Also, there should be a DomainSite record linking the Site to the Domain. Right?
I query both the Domain and DomainSite objects (as a System Administrator), and both queries return no results.
I want to check, from Apex code (or using the Metadata API or something) whether there's a Force.com Sites domain set already on the org, and it's sub-domain component. Even when there are no sites created (I guess in that case I could query for a Site record with Type = Force.com Site, and use the SubDomain value?).
The final objective here, is being able to programatically create a Force.com Site. We intend to use the Metadata API for doing this.
Any ideas? Thanks!
Not sure why you are not getting,But still i would suggest you to consider below points from salesforce document.
Customer Portal users can’t access this object.
To view this object, you must have the “View Setup and Configuration” permission.
Site.com Publisher users have read-only API access to the Domain and DomainSite objects.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_domain.htm
Hope this helps you!
Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
Thanks and Regards
Sandhya
Found lots of material regarding how to obtain the URL of a configured Site. But this isn't the case, what I want is to obtain the Force.com Sites configured domain (something that is done once and cannot be changed), in order to:
- Programatically check if this has been done, and if not instruct the user in the right direction
- Programatically create a Force.com site, but for this I need to pass a subDomain value? We are planning on using the Metadata API for this point.
Any ideas? Anyone?Has anyone been able to find a solution for this issue? I want to get also the site domain. I query both the Domain and DomainSite objects (as a System Administrator), and both queries return no results but if I go to Setup -> Domain -> The Force.com Site domain is listed there.