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
Manu@devManu@dev 

How to convert one record data to XML and send email

Hi all,

I am using standard controller to show all the fields and fields values of a particular object in VF Page. 

Now I have created one button on the VF page. On click of the button the entire record should be send as an email in XML format. 

I am not getting any way to convert the data into XML. 

Can someone help how can I achieve this requirement.

Thanks,
Manu
Best Answer chosen by Manu@dev
Grazitti TeamGrazitti Team
Hi,

I have find some links which will be helpful to solve the isssue.

1. http://it.toolbox.com/blogs/anything-worth-doing/a-better-way-to-generate-xml-on-salesforce-using-visualforce-55433
    (It is used to convert the data of an object to Xml )


2. http://www.cloudforce4u.com/2013/07/send-email-in-apex-salesforce.html
    (It is used to send the Xml through email.)


Note:  You should set the Xml in the "setPlainTextBody"  function.

Please mark as best answer if it solves your problem.

Regards,
Grazitti Team,
www.grazitti.com



All Answers

RadnipRadnip
You will need to add a controller extension class. Then create a method in the class to convert the fields you want into XML and then send the email. Checkout: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_xml_support.htm
Grazitti TeamGrazitti Team
Hi,

I have find some links which will be helpful to solve the isssue.

1. http://it.toolbox.com/blogs/anything-worth-doing/a-better-way-to-generate-xml-on-salesforce-using-visualforce-55433
    (It is used to convert the data of an object to Xml )


2. http://www.cloudforce4u.com/2013/07/send-email-in-apex-salesforce.html
    (It is used to send the Xml through email.)


Note:  You should set the Xml in the "setPlainTextBody"  function.

Please mark as best answer if it solves your problem.

Regards,
Grazitti Team,
www.grazitti.com



This was selected as the best answer
Manu@devManu@dev
Thank you Grazitti Team,

Your links helped me a lot.

R - Manu
Methew AndrewMethew Andrew
Helpful information thanks