Hello and thanks for reading :)

I've been asked to develop a Lightning Component (Aura) to upload a pdf File to the related Opportunity.

That was done with a lightning:fileUpload and works OK!

Now they asked me if I could add a textbox in the component where the user should type a description before clicking the button to submit the file.

They want THIS description (the user typed in) to be binded to the description of the File being uploaded. So, after uploading the File, I should be able to click the Files related list and in the "Description" field on that file I should see the same description that the user typed in the component.

I thought it was an easy requirement but I can't find the File object in Salesforce, neither in the Opportunity fields (no relationship there) so I don't see any way on how I'm supposed to do this.

Any ideas ?

1 Answer 1


The files are uploaded to ContentDocument records (one per uploaded file), so you would need to use the onuploadfinished event to get the documentId, and from there, use force:recordData or a custom Apex method to update the description afterwards.

  • I will try this and select the best answer if so, thanks a lot :D Oct 16, 2020 at 15:17

You must log in to answer this question.

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