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
cased19cased19 

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.

 

Example:

Account website: http://www.mysite.com

New Link or Button: http://www.somesiteoutthere.com/research/search.aspx?q=mysite.com&type=answers 

 

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?

 

Thanks.

ZetaZeta

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:
    http://www.somesiteoutthere.com/research/search.aspx?q={!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