Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Object on AWF button to make synchronous calls

SathyaPriyan_
Contributor III

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.

0 REPLIES 0