Create a map instead of list and finally if you want to insert or update the map values then you can insert or update.
Sample Code:
Map<Id, Account> mapAccount = new Map<Id, Account>();
for(Account acc : listAccount){
...............
...............
mapAccount.put(acc.Id, acc);
}
update mapAccount.values();
Note: Update Map value instead of List..
Cheers...
Sample Code:
Map<Id, Account> mapAccount = new Map<Id, Account>();
for(Account acc : listAccount){
...............
...............
mapAccount.put(acc.Id, acc);
}
update mapAccount.values();
Note: Update Map value instead of List..
Cheers...
No comments:
Post a Comment