• Suresh Kandru
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Architect

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,
Can we have action.setCallback() inside another action.setCallBack()??
My code goes like this:

controller.js
doInit : function(cmp,event,helper){
//call apex server method1 
action1.setCallBack(this,function(response){
    console.log('INSIDE action1');
    if(state == "SUCCESS"){
      //call apex server method2
     action2.setCallBack(this,function(resp){
          console.log('INSIDE action2');
      });
   }
});
}

On executing this code, 'INSIDE action1' is getting logged whereas 'INSIDE action2' is not getting logged. But apex method2 is getting invoked and both the apex methods works fine. 
Can we have an action.setCallback() inside another action.setCallback()??

Thanks,
Mythili