I am using an embedded Visualforce page as a custom button to update a custom field on my Opportunity record. The page saves fine and shows on my page layout, but when I click it, nothing happens. Does anyone see anything that could be causing this in my code below?
VF Page:
<apex:page standardController="Opportunity" >
<apex:includeScript value="/soap/ajax/26.0/connection.js"/>
<script type="text/javascript">
function evp();
{
var opp = new sforce.SObject("Opportunity");
opp.id = //set Record Id here, potentially get it from the URL ?id= param
opp.Approval_Status__c = 'Sent to EVP';
sforce.connection.update([opp]);
window.location.reload(); //to reload the window and show the updated values
}
</script>
<apex:form>
<div style="text-align: center"><p/>
<apex:commandButton Value="EVP Approval" onClick="evp();return false;"/>
</div>
</apex:form>
</apex:page>