JS Controller
onconfirm : function(component, event) {
var windowHref = window.location.href;
var url = new URL(windowHref);
var recordId = url.searchParams.get("c__recordId");
var recordtype = component.get("v.selectedRecordType");
console.log('recordType : ' + recordtype);
console.log('parameter : ' + recordId);
var action = component.get("c.CreateNewCon");
action.setParams({
"recType" : recordtype
});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
console.log("This is Success");
// I'd like to move from here to url.
} else {
console.log('This is Error');
}
});
$A.enqueueAction(action);
}
I want to process the following code successfully in apex controller and go to the URL when the status is SUCCESS. What should I do?