You need to sign in to do that
Don't have an account?
retrive a force.com site domain
I am trying to fetching my force.com site domain I have created. Gone through lot of internet contents but find no where a solution to fetch the complete Domain/Default site url. Possible is to query urlPathPrefix and salesforce.com domain, but not the complete force.com domain I have created.
for example: ***-developer-edition.ap2.force.com
***-developer-edition.na3.force.com
***-developer-edition.XYZ.force.com
could be fetched properly!
for example: ***-developer-edition.ap2.force.com
***-developer-edition.na3.force.com
***-developer-edition.XYZ.force.com
could be fetched properly!
Use the below SOQL Query for getting the force.com site domain.
Use below SOQL Query for getting the org instance Id/Name.
Let me know if this helps for you :)
Thanks,
Amit Singh.
All Answers
This answer may help you.
http://salesforce.stackexchange.com/questions/14532/get-visualforce-url-with-custom-domains-turned-on
Use the below SOQL Query for getting the force.com site domain.
Use below SOQL Query for getting the org instance Id/Name.
Let me know if this helps for you :)
Thanks,
Amit Singh.
Not sure if this issue is resolved for you. Apart from Amit's reply above, we also have a getDomain() method in the Site Class. Or you can use the getBaseUrl() method in the same Site class and parse it.
More Information:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_sites.htm
Thanks,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Site Class will provide you