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
Tim Chadwick 11Tim Chadwick 11 

lightning:openFiles

I all, Currently working on something to open a image of a file, However following the support documents the function does not seem to work, (e.lightning:openFiles). There seems to be very little documentation on this area. This is my code, (CMP)
 
<aura:dependency resource="markup://lightning:openFiles" type="EVENT"/> 
    <lightning:button variant="brand" label="Preview Reciept" onclick="{!c.preview}" />

(CMPController)
 
console.log('enter');
        var action = $A.get('e.lightning:openFiles');
                
        if(action){
            action.setParams({
                "recordIds" :['0690Y000001GnHVQA0','0690Y000001GfdFQAS'],
                "selectedRecordId" : "0690Y000001GnHVQA0"
            });
            action.fire();
            
        }else {
            console.log('failed hard');
        }
        
        console.log('exit');

The console logs as follow:
enter
failed hard
exit

So it looks like the action variable does get initalised by the openFiles function. Can anyone help here?
 
Tim Chadwick 11Tim Chadwick 11
Never Mind, Looks like the issue is down to the event not firing when looking at it from the 'Preview App' function.
​Does fire when loaded from lightning Tab