You need to sign in to do that
Don't have an account?
LIM AI KHOON
Custom button to execute a Approval process
Hi, currently when my user click on approve/reject button, it will bring user to a link from flow builder. Once user click the link, it will redirect user to approval page (process approval). Is it possible if the button is directly bring user to approval page (approval process) without go to a page from flows builder?
Please let me know if you need more clarification on this.
Thank you :-)
Please let me know if you need more clarification on this.
Thank you :-)
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var result = sforce.connection.query("SELECT Id FROM ProcessInstanceWorkitem WHERE processInstance.TargetObjectId='{!objectName__c.Id}'");
var approvals = result.getArray("records");
if(approvals != undefined && approvals.length > 0) {
var approvalID = approvals[0].Id;
window.open('/p/process/ProcessInstanceWorkitemWizardStageManager?id='+approvalID);
}
else {
alert("There are no approvals pending.")
}