Skip to content

Instantly share code, notes, and snippets.

@pfeilbr
Created March 24, 2015 14:04
Show Gist options
  • Save pfeilbr/6a6e9593b71f23d664a3 to your computer and use it in GitHub Desktop.
Save pfeilbr/6a6e9593b71f23d664a3 to your computer and use it in GitHub Desktop.
class NonMatchedAccountExporter {
public void run(List_MRK__c listID) {
Boolean moreToProcess = execute(listID);
while(moreToProcess = true) {
moreToProcess = execute(listID);
}
}
public Boolean execute(List_MRK__c listID) {
// SOQL to return non-matchs List Attachment Item records up 2000
// [select Item_ID_MRK__c from List_Attachment_Item where limit 2000]
String idsString = '';
for (List_Attachment_Item lai : [select Item_ID_MRK__c from List_Attachment_Item where limit 2000]) {
idsString = idsString + lai.Item_ID_MRK__c + '\n';
}
// Assume these methods will already exist
//AttachmentServices.createAttachment(listID, idsString)
//AttachmentServices.appendToAttachment(listID, idsString)
return records.size() == 2000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment