Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Account> uniqueIdMatchAcc = new List<Account>();
- if(allUniqueIDs.size()>0){
- uniqueIdMatchAcc = [Select id, unique__c From Account Where unique__c in :allUniqueIDs];
- }
- if(uniqueIdMatchAcc.size() > 0 ){ //if unique matches were found, feed Id's into registrationList created earlier
- for(Account uma : uniqueIdMatchAcc){
- for(registration crl : registrationList){
- if(uma.unique__c == crl.acc.unique__c){
- crl.acc.Id = uma.Id;
- }
- }
- }
- }
- Map<String,Account> uniqueIdMatchAccMap = new Map<String,Account>();
- for(Account a: [Select unique__c From Account Where unique__c in :allUnique]){
- uniqueIdMatchAccMap.put(a.unique__c, a);
- }
- if(uniqueIdMatchAccMap.size() > 0 ){
- for(String unique : uniqueIdMatchAccMap.keySet()){
- for(registration rl : registrationList){
- if(unique == rl.acc.unique__c){
- rl.acc.Id = uniqueIdMatchAccMap.get(unique).Id;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement