[SalesForce] Lightning out App error in callback function

I had created a lightning component to upload multiple files with the help of this URL how to create upload multiple file url

which is working fine in action button but when I try to call that component in my VF page having the issue of Lightning out App error in callback function

To use the lightning component in VF page I follow this URL:-
how to call component in VF page

and here is my vf page code:-

<apex:includeLightning />
<div id="fileMultiContainer" />
<script>
    $Lightning.use("c:UploadFileApplication", function() {
      $Lightning.createComponent("c:UploadFile",
          {},
          "fileMultiContainer",
           function(cmp) {
               component.set("v.recordId",'{!order.Id}');
            });
     });
 </script>

Can someone please help me where I did wrong.

Best Answer

Documentation: Usage Considerations

This component is not supported in Lightning Out or standalone apps, and displays as a disabled input. Additionally, if the Don't allow HTML uploads as attachments or document records security setting is enabled for your organization, the file uploader cannot be used to upload files with the following file extensions: .htm, .html, .htt, .htx, .mhtm, .mhtml, .shtm, .shtml, .acgi, .svg. For more information, see Upload and Share Files in Salesforce Help.

In short, below are not allowed:

  1. Don't allow HTML uploads as attachments or document records security setting

  2. Lightning Out or standalone apps - is not supported

You are using lightning out and so will not work

Related Topic