Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global database.QueryLocator start(database.BatchableContext bc){
- return database.getQueryLocator('Select id,MemberShip__c,Two__c,name From Account');
- }
- global void execute(database.BatchableContext bc,list<Account> acc){
- list<string> se=new list<String>();
- for(Contact c:con){
- if(c.AccountId!=null){
- se.add(c.MemberShip__c);
- }
- }
- for(Account a:[Select id,MemberShip__c,Two__c,name From Account where id in:se]){
- a.MemberShip__c=string.join(se,',');
- acc.add(a);
- }
- update con;
- }
- global void finish(database.BatchableContext bc){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement