Skip to main content

Posts

Showing posts with the label Promise function in salesforce

How to have Chaining Promises in Lighting Component ?

We may need to call multiple apex function from aura component, each function is dependent to other function. In that case we may have call promise function inside another. Here is the sample code @AuraEnabled public   static   Opportunity  getOpportunity( String  opptyId){          return  [ select  id,name,stagename  from   Opportunity   where  id= 'opptyId' ]  } @AuraEnabled public   static   Boolean  checkFormAttached( String  opptyId){          Boolean  isNotAttached =  true ;          set < String > setOfNames =  new   set < String > { 'Admission Notification' , 'EligibilitySummary' , 'BAForm' };          List < ContentDocumentLink > contLinks = [ SELECT  id,contentd...