You need to sign in to do that
Don't have an account?
BenP
java button to call approval process
I have a little java button that checks a few items before changing the status via a trigger. What I'd like to do is keep the checks in place, but at the end submit the item to my approval process. Problem is, I don't know how to call an approval process via java script. Can anyone point me in the right direction? I'm not a developer, but am not afraid to put in the effort.
if('{!SVMXI__Parts_Request__c.Status__c}'=='Submitted'){ alert('This Sales Order is already submitted to QAD'); } else if('{!SVMXI__Parts_Request__c.Status__c}'=='Complete'){ alert('This Sales Order is already submitted to QAD'); } else if('{!SVMXI__Parts_Request__c.Status__c}'=='Processing'){ alert('This Sales Order is already submitted to QAD'); } else if('{!SVMXI__Parts_Request__c.Total_parts_line__c}' <=0){ alert('There are no line items to submit'); } else{ document.location.href="/apex/SVMX_PRStatusUpd?id={!SVMXI__Parts_Request__c.Id}"; }
The workflow approval process is fired automatically (based on the configurations) like triggers. I don't think the approval process can be called from java script or trigger. The reason I think it's not possible is because how would you get the control from the approval process with in java script.
I'd rather implement such requirement in a Visual Force page and would program the approval process logic in some class - just a thought :D
Thanks!
Working this into the button will call the approval process.
Credit to James Sullivan.