List<Account> ls = new List<Account>{new Account(name='Acme Inc.'),new Account(name='Acme')}; insert ls; Account masterAcct = [select id, name from account where name = 'Acme Inc.' limit 1]; Account mergeAcct = [select id, name from account where name = 'Acme' limit 1]; try {merge masterAcct mergeAcct; } catch (DmlException e) { // Process exception here }
No comments:
Post a Comment