+ Start a Discussion
DilluSalesForceDilluSalesForce 

Adding Body of TWO attachments into a single attachment....

Hi,

    Is there any way to add body of two  attachments into a single attachment.

 

i have tried it in the following way

 

PageReference StatementPDF = Page.GeneratePDF;

StatementPDF.getParameters().put('Id','001T000000DppRD'); StatementPDF.setRedirect(true);

Blob p = StatementPDF.getContent();

 

Blob x = p;

x = Blob.valueOf(p + x);

 

Attachment objAttachment = new Attachment(); objAttachment.parentId = '001T000000DppRD';

objAttachment.Body = x;

objAttachment.Name = 'MonthlyStatement.pdf'; objAttachment.ContentType =

'application/pdf';

insert objAttachment;

 

 

but the Problem is it is not displaying any content(though i have content in GeneratePDF) itz juz showing a blank PDF.

Pls do the needful. 

 

DilluSalesForceDilluSalesForce
Pls help me with this....is there any way to do so......?????