0

I wrote this code as JS controller of a component to invoke a VF Page but here it is showing that This error

This page has an error. You might just need to refresh it. Action failed: c:DataProcessor$controller$downloadDocument [sendDataProc is not a function] Failing descriptor: {c:DataProcessor$controller$downloadDocument}

({
 downloadDocument : function(component, event, helper){
     console.log("line 3");
  var sendDataProc = component.get("v.sendData");
     console.log(sendDataProc);
  var dataToSend = {
     "label" : "This is test"
  }; //this is data you want to send for PDF generation
console.log(dataToSend);
  //invoke vf page js method
   sendDataProc(dataToSend, function(){
             console.log('hello');
  });
 },
    
})
James Z
  • 12,209
  • 10
  • 24
  • 44
  • Aura or lwc? Looks like aura... What is sendData, a method from apex class? Do you have permissions to run this class? Is the apex class mentioned in aura component's top tag? Why do you call directly instead of "enqueueAction"? – eyescream Apr 01 '23 at 18:02
  • It is an Aura component SendData Is an Attribute on Aura component with Object Type and here I want to invoke function on VF page from here but It is showing that sendDataProc is not defined function error, I want to resolve this code link is https://gist.github.com/toanshulverma/16244d19ac68364cb75443695d81403b – Harshit Chaubey Apr 02 '23 at 07:13

0 Answers0