0

I'm using lightning:fileUpload in my lightning component to upload files. Now I need to upload the same file to both parent and child case at the same time. Is there any possibility to do that?

<lightning:fileUpload name="fileUploader" multiple="true" recordId="{!v.caseId}" onuploadfinished="{!c.handleUploadFinished}" />

Can we specify more than one recordId in lightning:fileUpload tag

1

The lightning:fileUpload component takes only one ID but in the handler for onUploadFinished event, you get the Document ID back. You can make another server call to create a new ContentDocumentLink object record.

Please note these will be two different transactions so based on the requirement you may need to write your own rollback logic.

| improve this answer | |
  • Yes !!! Tried the same !! Worked !!! Thanks alot manjit – sfdcOwl Apr 6 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.