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
Raffaele MessinaRaffaele Messina 

CSV and objects relationships

hi everybody
i've made an lwc that displays all csv files that i have stroed into salesforce internal files storage. These CSVs serve as a backup, in fact i have all the records for a selected object (eg Account) into the csv.
Later the user can decide if he wants to "restore" the backup. In this case when i restore the backup i want to restore also the eventual relatsionship, eg account-contact. how can i implement this logic? Beacuse when inserting records, salesforce assigns new ids, so the relationship won't be maintained
ShirishaShirisha (Salesforce Developers) 
Hi Raffaele,

Greetings!

I don't think there is any direct way to retrieve the files along with the related recordId.However,you can try with the below SOQL query to check based on individual Object.
 
SELECT ContentDocumentId, LinkedEntityId  FROM ContentDocumentLink where LinkedEntityId in ( SELECT Id FROM Case ) and LinkedEntity.Type='Case'

Reference:
https://developer.salesforce.com/forums/?id=9060G000000BgW6QAK

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri