6

I'm creating a component to export some data to a .csv file, the creation of the file works great in Apex but when I get the Id back and try to navigate to it it fails, I've tried with

     const navEvt = $A.get("e.force:navigateToSObject");
           navEvt.setParams({
                  "recordId": id,

                });
           navEvt.fire();

And

    $A.get('e.lightning:openFiles').fire({
          recordsId : [id],
          selectedRecordId : id
     });

But I can't seem to display the file (I've also tried with the ContentDocumentId)

1
  • Are you getting an error message?
    – Doug Ayers
    Feb 17, 2017 at 2:37

1 Answer 1

3

Perhaps try navigateToUrl event: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_navigateToURL.htm

var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
  "url": '/' + fileId
});
urlEvent.fire();
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .