You need to sign in to do that
Don't have an account?
llisa
Declare two attachments in a apex program.
Hello Everyone,
My query is how to differenciate two attachment i.e 2 list for two different attachments in two different page block section..
public List<Attachment> attachments{get;set;}
public List<Attachment> attachments1{get;set;}
Here i create Two different Pageblock Section for both of the attachments.but the problem is that
- i am unable to differenciate both the attachments i.e both page blocksections fetch same data from both attachments.
So give some idea how i differenciate this two different attachments?
My query is how to differenciate two attachment i.e 2 list for two different attachments in two different page block section..
public List<Attachment> attachments{get;set;}
public List<Attachment> attachments1{get;set;}
Here i create Two different Pageblock Section for both of the attachments.but the problem is that
- i am unable to differenciate both the attachments i.e both page blocksections fetch same data from both attachments.
So give some idea how i differenciate this two different attachments?
You need to differentiate teh attchments while assigning to the list .Can you explain your requirment with bit more clarity for solution .
Thanks
Manoj
Thanks for your reply.
1.The Senario is i have 2 different pdf attachments which are related to 2 different buttons.i.e by clicking those buttions there respective pdf will generate and stores in its respective page block section in custom detail page.
2.But here my problem is i am unable to differenciate this two pdf in two diffn page block section.
i declare 2 diffn list
public List<Attachment> attachments{get;set;}
public List<Attachment> attachments1{get;set;} for 2 pdf.
3. to display those pdf in cuatom detail page i wrote query
attachments=[select id,name,Body,CreatedDate from Attachment where parentId=: documentId Order By CreatedDate Desc];
attachments1=[select id,name,Body,CreatedDate from Attachment where parentId=: documentId Order By CreatedDate Desc];
4. so now to create one pdf if i click its respective button the pdf is generated and stores in both pageblock section insteed of its respective one.