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

how to upload multiple attachments to multiple records

Hi All,

I have a requirement to upload multiple attachments to multiple records in visual force table, i am displaying the list of records from different tables in visualforce page, i want to upload the multiple attachments to every record in that table.Please any suggestions.Please find the below image for reference.

User-added image

You can Use warpperclass to map the attachments to the record and you can insert them to notes and attchments of that record. 
You can use blob content type for that.
Thank u for ur suggestion, but hear my requirement is changed, i need to upload multiple files to one parent record while creation of the that record,  
i have used inputfile tag in my page,i am getting this error (
apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.), if i want to escape from this error i need to use java script code in my page, i found some java script code for multiple attachments, but in this code i need to pass the parent id but while creation of the record i don't have parent id, i don't have much knowledge in java script, in my scenario first i will insert the parent record then i have the parent id, but i don't know how to pass that parent id to parent id in java script in visualforce page.

Please see this link for java script code :

Please give me some suggestuon or sample code.