Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2023-06-13 08:53 AM - edited 2023-06-13 09:01 AM
I have Application A and B with advanced workflow enabled and I'm trying to execute API call from application B to click advanced workflow button resides in application A. This has to be done in a sequential order.
When User clicks "enroll" in Application B,
1. My custom code should wait until completion of record enrollment into advanced workflow.
2. start the Rest API calls to get into the related record of Application A and click the workflow user action button.
I have tried with callback functionality as below, But functions are getting triggered immediately rather than waiting for the system to enroll application B record into the workflow.
$('.tb-btn-link-left:contains("AWF button name")').unbind('click');
$('.tb-btn-link-left:contains("AWF button name")').bind('click', (function(){
function mainfun(getfuncall){
startWorkflow('Start_WF'); // This is Archer native function binded with enroll button
getfuncall();
}
function callBack(){
console.log("test2");
}
mainfun(callBack);
}));
Any help on making the function calls synchronous in this case would be much appreciated.