2. From time totime;there comesa requirementtowrite afile toyour desktopandthenhave itFTP over
to anotherlocation.
Openan APEXpage and copy the followingtest code:
<apex:page controller="GenerateContactTXT"contentType="text/plain#Contact.txt"cache="true">
"Title","FirstName","LastName"
<apex:repeatvalue="{!Contacts}"var="con">
<apex:repeatvalue="{!con}"var="asub">
"{!asub.Title}","{!asub.FirstName}","{!asub.LastName}"
</apex:repeat>
</apex:repeat>
</apex:page>
Create a class GenerateContactTXT:
public Class GenerateContactTXT{
public List<Contact> getContacts() {
return [selectId,Title,FirstName,LastName from Contactlimit20];
}
}
Load your APEX page and you should be able to have the file downloaded to your desktop.