[SalesForce] Javascript navigate to visualforce page button

I basically need to mimic the button content source: Visual Force Page logic
enter image description here

I can't use the Visual force drop down button because I need to check that a field is filled in first. So I need to use the javascript option instead, but still need to navigate to a visual force page. I also can't make that field mandatory before saving.

Code:

var id = '{!Case.Paradigm_ID__c}';
if(id.length == 0){
     alert("No Paradigm ID, SSRS History will not be linked");
}
else{

     window.location = //link to visual force page here
}

Best Answer

window.location.href='/apex/VFPageName'
Related Topic