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
Anu Raj.ax1269Anu Raj.ax1269 

Different attachment in same VF page

Hi

I have a VF page with 5 input File attachment. I want 5 different attachment on the each of them. eg: Their are 3 different fields 1. Name, 2. Job, 3. Resume . So like this their are 5 fields. If 1st Name = Anu, Job = SFDC dev , resume = attachment1 2nd Name = ram, job = SFDC dev, resume = attachment2 etc. Their is no field called attachment in object. I need to attach the attachment to the record we create. Is it possible. Please help me to solve this issue.

Thanks

Anu

mauricio.ramosmauricio.ramos

Hello Anu,

 

I am not sure I understand fully your post, but if I got it right, then what you need to do is add one <apex:inputFile> for each attachment you want uploaded. The input file tag will enable the selection of files to be uploaded. In Sf you don't have an attachment field, but rather it is a relationship between the parent (your sObject) and the Attachment object in SF. 

 

Then in your controller create the Attachment record pointing to the sObject your working on and it should give you what you need.

 

Hope this helps you get your solution.