I'm getting 'credCycleId is not defined' error at the run time execution of my lightning component.
when i'm trying to assign the value of my attribute 'parentcredCycleId' to 'credCycleId' parameter in controller, it's throwing an error.
i have verified below things from my end:-
var hh1 = component.get("v.parentcredCycleId"); //this is showing NULL
alert('---hh1'+hh);
alert('--resp'+response.getReturnValue()); //this is showing correct value.
var hh = component.get("v.parentcredCycleId"); // this is again showing null
alert('---hh'+hh);
Below is my helper method for your reference. Please help.
({
getQuickLinkWrapperList : function(component, event, helper) {
var action = component.get("c.getCredCycleId");
var sObjectRecordId= component.get("v.recordId");
var sObjectAPIName= component.get("v.sObjectName");
action.setParams({
childRecordId: sObjectRecordId,
childAPIName : sObjectAPIName
});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
component.set("v.parentcredCycleId",response.getReturnValue());
var hh1 = component.get("v.parentcredCycleId");
alert('---hh1'+hh);
alert('--resp'+response.getReturnValue());
this.handleSuccess(component, response.getReturnValue());
} else {
this.handleError(component, response.getError());
}
});
var hh = component.get("v.parentcredCycleId");
alert('---hh'+hh);
var action1 = component.get("c.getQuickLinkWrapperList");
action1.setParams({
credCycleId: component.get("v.parentcredCycleId")
});
action1.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
this.handleSuccess(component, response.getReturnValue());
} else {
this.handleError(component, response.getError());
}
});
$A.enqueueAction(action);
$A.enqueueAction(action1);
}
})