function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Brian11Brian11 

How to handle the callback using Quick ActionAPI

I am firing a  quick actions using the actionApi from a lighting component. The action fires but I dont have access to a callback so that I can execute other functions to refresh my component.

The console.log below fires when the quickAction modal is open. It is not after it is closed. Does anyone have a workaround?
 
actionAPI.selectAction(args).then(function (result) {
            var fields = result.targetableFields;
            console.log("im here", fields)
        }).catch(function (e) {
            if (e.errors) {
                //If the specified action isn't found on the page, show an error message in the my component 
            }
 });

 
Raj VakatiRaj Vakati
You can do it as below Step 1: 

Create an attribute in the component  like below
<aura:attribute name ="errorMssae" type="String"/>
<aura:attribute name ="isShowError" type="boolean"/>




Ste p2 : Set the value
actionAPI.selectAction(args).then(function (result) {
            var fields = result.targetableFields;
            console.log("im here", fields)
        }).catch(function (e) {
            if (e.errors) {
cmp.set("v.errorMssae" , errors[0].message) ; 
cmp.set("v.isShowError" , true) ;

                //If the specified action isn't found on the page, show an error message in the my component 
            }
 });



 
Raj VakatiRaj Vakati
Let  me know its wokring or not?