Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Map<Id, Contact> cons = new Map<Id, Contact> ([
- SELECT Id, Organization__c
- FROM Contact
- WHERE Organization__c = 'FXCMASIA'
- ]);
- List<Task> result = [
- SELECT Id, AccountId, ActivityDate, Comments__c, CreatedDate, Created_Date_Time__c, Department__c, Description, Details__c,
- OwnerId, Phone_Number__c, Priority, Status, Subject, Subject_Comments__c, WhatId, WhoId
- FROM Task
- WHERE (WhoId IN: cons.keySet())
- ORDER BY Id ASC
- ];
- Set<Id> ids = new Set<Id>();
- for (Task t:result) {
- ids.add(t.Id);
- }
- List<String> fields = new List<String> { 'Id', 'AccountId', 'ActivityDate', 'Comments__c', 'CreatedDate', 'Created_Date_Time__c', 'Department__c', 'Description', 'Details__c', 'OwnerId', 'Phone_Number__c', 'Priority', 'Status', 'Subject', 'Subject_Comments__c', 'WhatId', 'WhoId' };
- System.debug(ids.size());
- XMLCreator batch = new XMLCreator(ids, 'Task', fields, 'dboychev@fxcm.com', 'TasksRelatedToCase');
- Database.executeBatch(batch, 200);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement