You need to sign in to do that
Don't have an account?

attach all child record as attachment to a parent with a custom button
Hi All,
We currently have a requirement to save all the child records of a parent as a pdf attachment to the parent record and send an email to internal employee with all the child attachments and the parent record too.
Parent object: Fact_Find__c
Child objects: Super_checklists__c,Investment_Checklist__c, Cash_Flow_Analysis__c,Insurance_Checklist__c, Life_Style_and_Financial_Goals__c.
Our requirement is to send an email to the internal employess with all these records attached to the email. including the parent record.
I just need to know is there any way to achieve this?
Please guide me in the right way.
Thanks in advance.
Bathy
We currently have a requirement to save all the child records of a parent as a pdf attachment to the parent record and send an email to internal employee with all the child attachments and the parent record too.
Parent object: Fact_Find__c
Child objects: Super_checklists__c,Investment_Checklist__c, Cash_Flow_Analysis__c,Insurance_Checklist__c, Life_Style_and_Financial_Goals__c.
Our requirement is to send an email to the internal employess with all these records attached to the email. including the parent record.
I just need to know is there any way to achieve this?
Please guide me in the right way.
Thanks in advance.
Bathy
1. Create a vf page with the format you need for child records
2. Create a cutom javascript button that calls a class method.
3. In the class instantiate the vf page created in 1 and do getcontent()
4. Create a new attachment variable with body as the response from getcontent()
5. Attach the attchment to parent record
6.send email using the same info to requried users.
Thanks for your prompt response. I was thinking to go in the same way but was a bit unsure. Thanks for your suggestion. Would you be able to help me out in coding this? I came across some Apex code in http://blog.jeffdouglas.com/2010/07/14/attach-a-pdf-to-a-record-in-salesforce/ (http://blog.jeffdouglas.com/2010/07/14/attach-a-pdf-to-a-record-in-salesforce/)
I am trying to start from this. But I dont have idea how to do this for child objects. Sometimes there might be multiple child records for a single child object. Would you be able to help me by modifying this code?
Thanks,
Bathy.
This will display the child records in the same page. can we have them as attachments instead so that I can trigger an email with all the attachments.
Thanks,