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
Prakhyat sapraPrakhyat 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);
    }
    
AnkaiahAnkaiah (Salesforce Developers) 
Hi Prakhyat,

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!!
mukesh guptamukesh gupta
Hi Prakhyat,


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


 
Prakhyat sapraPrakhyat sapra
Hiiii Thanks for the reply. But I used this method it doesn't help me......