Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //members con potencial problema
- Set<Id> membIds = new Set<Id>();
- for(fieloplt__transaction__c tx : [select fieloplt__member__c from fieloplt__transaction__c where FIELO_DeviceActivity__c != null]){
- membIds.add(tx.fieloPLt__member__c);
- }
- for(FieloPLT__Member__c member : [SELECT FieloPLT__Points__c, (SELECT FieloPLT__Balance__c FROM FieloPLT__Points__r) FROM FieloPLT__Member__c where id in: membIds]){
- Decimal points = 0;
- for(FieloPLT__Point__c point : member.FieloPLT__Points__r){
- points += point.FieloPLT__Balance__c;
- }
- if(points != member.FieloPLT__Points__c){
- System.debug('el member ' + member.Id + ' tiene problemas');
- }
- if(points == member.FieloPLT__Points__c){
- System.debug('el member ' + member.Id + ' está bien');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement