Contents
How do I get Apex community URL?
Apex : Get Community URL
- Find out the URL prefix for your community. You can find the community URL prefix for a community on the experience page, from there there is a list of communities and their associated URL.
- Query the Site Object.
- Query the SiteDetail Object.
How do I get a domain name from Apex Salesforce?
Use getOrgDomainUrl() in orgs with or without My Domain to retrieve canonical URLs. For example: https://yourDomain.my.salesforce.com, or, for orgs without My Domain enabled https://yourInstance.salesforce.com.
How do I find my community ID in Salesforce?
The IDs of the Communities can be found when executing the following debug log statement: System. debug(‘#####’ + ConnectApi.
How to get base URL in apex class?
You can use URL.getSalesforceBaseUrl ().toExternalForm () to get the base url. Append the record id to this url and your problem would be solved. I want to pass some parameters in url to another page with hidden way. so i tried using getheaders () instead of getparameters (). but this was not works.
How can I get all communities in apex?
You will get the domain and then all communities and you can build your logic. ConnectApi.Communities.getCommunities () This works from developer console as well as from apex class, but you must use API 28.0 (or above). Hope this information is helpful for you.
How to get community url in Salesforce developer community?
Please store Community URL into a custom setting or Custom Label, then access it in apex class. Hope this will help you, let me know if you still face issues in it. You will get the domain and then all communities and you can build your logic.
How to get the exact URL of a website?
To get the exact URL in a sites scenario I think you’d need to combine Site.getCurrentSiteUrl () with ApexPages.currentPage ().getUrl (), stripping out the /apex/ part in getURL. Not exactly sure what you mean about an extension. If it’s like a folder name, then yes that can be done when defining the site.