How to I open the approval/rejection page for a record with a javascript button?
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
if({!AND(ISPICKVAL(Repair_Estimate__c.Approval_Status__c, 'Pending-PM Approval'),
OR(
AND(ISBLANK(Repair_Estimate__c.Job__c),
ISBLANK(Repair_Estimate__c.Project__c))))})
alert("The job or project needs to be attached to the estimate in order to be approved.")
else{
window.open('/p/process/ProcessInstanceWorkitemWizardStageManager?id={!Repair_Estimate__c.Id}');
}
The only thing that isn't working is the else function. I've only got the button to open a single, hardcoded ID record. I get this error:
"Unable to Access Page The value of the "id" parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information. "