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

Stripping http://. from URL field into a new field

I have a project that requires me to create a link (or button) that contains the domain from the Account screen (Website) in the path.



Account website:

New Link or Button: 


I'm thinking that the easiest way would be to create a new hidden field called domain and have a formula grab the URL and strip the http://www. However.... I have no idea how to do that or if there is a better way to accomplish this.


Could anyone offer some suggestions?




Here's my suggestion,



if the only thing that changes is the
"website", you can add to your controller a method called, for example "getAccDomain()",

It could be something like:

public String getAccDomain(){
    return grabHTTPAway(Account.domain);

Then, in the url of the button or link you can type:{!AccDomain}&type=answers

When the page loads, {!AccDomain} will call the method getAccDomain() and replace
that part of the link with the return value.

Hope this helps, if not, please explain me further and i'll try to assist you.


- Zeta