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
Moritz MuellerMoritz Mueller 

navigate to the next screen after .setCallback

Hi all,

I would like to add another condition which forces the next step within a flow after a setCallback is reached;
 
action.setCallback(this, function(response) {
            var state = response.getState();
            console.log(response.getState());
            if (state === 'SUCCESS'){
                console.log('Response: ' + response.getReturnValue());
                var toastEvent = $A.get("e.force:showToast");
                toastEvent.setParams({
                    "title": "Success!",
                    "message": "entitlement applied.",
                    "type" : "success"
                });
                toastEvent.fire();
                component.find("overlayLib").notifyClose();
                navigate("NEXT");


Any idea what the correct call would be here? 

Thanks
 
Raj VakatiRaj Vakati
var navigate = component.get("v.navigateFlow");
 navigate("NEXT");

try this code 
 
action.setCallback(this, function(response) {
            var state = response.getState();
            console.log(response.getState());
            if (state === 'SUCCESS'){
                console.log('Response: ' + response.getReturnValue());
                var toastEvent = $A.get("e.force:showToast");
                toastEvent.setParams({
                    "title": "Success!",
                    "message": "entitlement applied.",
                    "type" : "success"
                });
                toastEvent.fire();
                component.find("overlayLib").notifyClose();
               var navigate = component.get("v.navigateFlow"); 
navigate("NEXT");

 
Moritz MuellerMoritz Mueller
Afraid that doesn't work;
Uncaught Error in $A.getCallback() [navigate is not a function]
Raj VakatiRaj Vakati
Are you testing your application from the standard .App ? 

It will wokk only from the salesforce LX  application 
Moritz MuellerMoritz Mueller
Yes, this flow is part of the guided action list within the service console and the case object. Tested in LX.