SHARE
TWEET

Untitled

a guest Feb 19th, 2020 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. List<Case> casesForCC = [
  2.         SELECT Work_Order__r.IOL_QuoteId__r.IOLF_NumeroCommissione__c
  3.         FROM Case
  4.         WHERE IOLE_Processo_di_Lavorazione__c != NULL AND Work_Order__c != NULL AND Work_Order__r.IOL_QuoteId__r.Owner.LastName = 'Piscozzi'
  5. ];
  6.  
  7. Set<String> numeriCommissione = new Set<String>();
  8. for(Case c : casesForCC) {
  9.     if(String.isNotBlank(c.Work_Order__r.IOL_QuoteId__r.IOLF_NumeroCommissione__c)) {
  10.         numeriCommissione.add(c.Work_Order__r.IOL_QuoteId__r.IOLF_NumeroCommissione__c);
  11.     }
  12. }
  13.  
  14. List<Case> cases = [
  15.         SELECT Work_Order__r.IOL_QuoteId__r.IOLF_NumeroCommissione__c
  16.         FROM Case
  17.         WHERE IOLE_Processo_di_Lavorazione__c != NULL AND Work_Order__c != NULL AND Work_Order__r.IOL_QuoteId__r.IOLF_NumeroCommissione__c IN :numeriCommissione
  18. ];
  19.  
  20. List<String> caseIds = new List<String>();
  21. for(Case c : cases) {
  22.     caseIds.add(c.Id);
  23. }
  24.  
  25. System.debug(caseIds.size());
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top