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
Prasan6Prasan6 

Custom button with dynamic url

Hi Guys, 
I would like to create a custom button with Content Source as URL. 
Is there a way we can can dynamic url i.e. with IF in the url? 
example
/a06/e?CF00N2700000behac={!Contact.Last_Name}&IF(Field='a value', RecordType=012O00000006Fiaa , RecordType=012O00000006Fibb)?

If not, can you please give me an example in Java Script

Thanks,
Hargobind_SinghHargobind_Singh
You can use Javascript, a simple example: 
 
if(<Your Condition>){
     window.location.href = "http://example.com";
}
else{
    window.location.href = "http://otherexample.com";
}

 
Gergo SzaboGergo Szabo
Can we use a custom button to open a VF page? We're scientists from the Szabo lab at Inter Dec College Montreal doing our term paper research https://www.writemyessayfast.ca/ services. Thank you for your assignment help.