I have employee record where I am having a custom Button "GeneratePayslip" after clicking on which I have written a VF page "GeneratePayslip" and on that VF page I select a Month and click generate button, on that click a new VF page is displayed as PDF - "GeneratePayslipPDF". I want to attach that generated PDF to the selected Employee after the Payslip is generated. How can I achieve this please guide me to get this problem solve.
I am almost written everything - Attachment, Blob, etc. Initially i was facing problem of .getContent() method of attachment object, but its solved by putting that code in TRY-Catch. Now there is no error messages but I did not Found the Attachment.