Advertisement
Guest User

para bandidinho

a guest
Apr 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. //members con potencial problema
  2. Set<Id> membIds = new Set<Id>();
  3.  
  4. for(fieloplt__transaction__c tx : [select fieloplt__member__c from fieloplt__transaction__c where FIELO_DeviceActivity__c != null]){
  5.  
  6. membIds.add(tx.fieloPLt__member__c);
  7.  
  8. }
  9.  
  10. 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]){
  11. Decimal points = 0;
  12. for(FieloPLT__Point__c point : member.FieloPLT__Points__r){
  13. points += point.FieloPLT__Balance__c;
  14. }
  15. if(points != member.FieloPLT__Points__c){
  16. System.debug('el member ' + member.Id + ' tiene problemas');
  17. }
  18. if(points == member.FieloPLT__Points__c){
  19. System.debug('el member ' + member.Id + ' está bien');
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement