You need to sign in to do that
Don't have an account?
Prakhyat sapra
how to handel this error Cannot read properties of null (reading 'getReturnValue')???
fireSearchBox : function(component,event,helper){
var searchBox;
console.log('enter123456');
//var value = searchBox.getSource().get("v.value");
var action = component.get("c.search");
action.setParams({"searchBox" :searchBox});
action.setCallback(this,function(response){
var state= response.getState();
console.log('state',state);
if (state=== "SUCCESS"){
var response= response.getReturnValue();
console.log('response',response);
component.set("v.searchBoxs",response.getReturnValue());
}
// component.set("v.productWrapper", a.getReturnValue());
});
$A.enqueueAction(action);
}
var searchBox;
console.log('enter123456');
//var value = searchBox.getSource().get("v.value");
var action = component.get("c.search");
action.setParams({"searchBox" :searchBox});
action.setCallback(this,function(response){
var state= response.getState();
console.log('state',state);
if (state=== "SUCCESS"){
var response= response.getReturnValue();
console.log('response',response);
component.set("v.searchBoxs",response.getReturnValue());
}
// component.set("v.productWrapper", a.getReturnValue());
});
$A.enqueueAction(action);
}
Refer the below links have solution for similar kind of issue.
https://developer.salesforce.com/forums/?id=9060G0000005USaQAM
https://salesforce.stackexchange.com/questions/129541/uncaught-error-in-a-getcallback-typeerror-cannot-read-property-setparams
If this information helps, Please mark it as best answer.
Thanks!!
Actually your code is not in proper way, like var searchBox; this is decleared but not assing any values and you are passing this null parameter to apex class that's why this issue occured
Please follow below url for your solution:-
https://developer.salesforce.com/forums/?id=9062I000000DJxaQAG
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh