There is custom button in Account object to redirect to Case recordtype selection page. The custom button URL is

/setup/ui/recordtypeselect.jsp?ent=Case&retURL=/500/o&save_new_url=/500/e?fromAccountId={!Account.Id}&retURL=%2F500%2Fo

But in community,the same custom button URL is not working and below error is coming

https://myorg.cs6.force.com/CommunityName is under construction

The button URL is having community name in it. Given below is the URL copied from community browser address bar:

https://myorg.cs6.force.com/CommunityName/setup/ui/recordtypeselect.jsp?ent=Case&retURL=%2FCommunityName%2F500%2Fo&save_new_url=%2FCommunityName%2F500%2Fe%3FretURL%3D%252FCommunityName%252F500%252Fo

Can anyone please advise, how to make custom url work both in sandbox and community.

I had the same issue not long ago. This "extra" bit Salesforce adds to the URL broke lots of buttons in my application. The solution was to avoid hardcoded links on the buttons, but I think you want to redirect to the record type change page.

With communities I think you are better off using a OnClick JavaScript that checks the user's profile before redirecting. If it is a community user, then redirect to the URL which contains the CommunityName, otherwise just redirect to the "normal" Salesforce URL.

I think this article would help you out:

https://help.salesforce.com/articleView?id=Issue-about-Custom-Button-and-Link-URL-in-Communities&language=en_US&type=1

  • If the article does in fact answer the question, please cite the relevant content here. Links can break over time, and a good answer should stand on its own even if each link goes dead. – Adrian Larson Apr 21 '17 at 13:57

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.