• Sam Cousins
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hi all, I have the following code:
 
global class ProcessLinkBetweenWorlds implements Database.Batchable<sObject>, Database.Stateful {
     
    global List<Account> accountList = new List<Account>();

    global Database.QueryLocator start(Database.BatchableContext bc) {
        
        accountList =  [Select PersonContactId, concat_ID__c, PersonEmail, Name FROM Account 
                       WHERE PersonEmail != NULL AND FirstName != NULL AND IsPersonAccount = TRUE 
            	       AND PersonMailingCountry != 'United Kingdom' AND Is_Master_Record__c = True]; // THIS QUERY IS TOO LARGE
		
        Set<String> accountConcatIds = new Set<String>();
        for(Account a: accountList) 
        {
            accountConcatIds.add(a.Concat_ID__c);
        }
        
        return Database.getQueryLocator(
                'SELECT ContactId, SuppliedEmail, concat_ID__c From Case ' + 
                'WHERE ContactId = NULL AND SuppliedEmail = NULL AND  Concat_ID__c IN :  accountConcatIds'
        );    
    }
     
    global void execute(Database.BatchableContext bc, List<Case> scope){
        System.Debug(accountList.Size() + '|' + scope.Size());
        for(Case c : scope) {
            for(Account a : accountList ) {
                
                if(a.Concat_Id__c == c.Concat_ID__c) {
                    // Match Found!
                }
            }
        }
    }    
    
    global void finish(Database.BatchableContext bc){
       
    }    
}

How can I make the accountList work inside the context of the batch? I would like to compare both lists for a match. Any other optimizations and improvements would be appreciated. 
Hi All,

I have the following javascript: 
 
document.getElementById("{!$Component.f.pageBlock3.pageMessage3}").TextContent.Style.Color = "Red";

How would I change the color of this element? The above doesn't seem to work. If I do

 
Hey all, I have the following:
 
<apex:inputHidden value="{!caseList1stLinePrevious.Subject}" id="theHiddenInput1" />

<apex:inputHidden value="{!caseList2ndLinePrevious.Subject}" id="theHiddenInput2" />

<apex:inputHidden value="{!caseList3rdLinePrevious.Subject}" id="theHiddenInput3" />

and in my controller: 
 
public class ITSSDashboardController
{

    public list<case> caseList1stLine{get;set;}
    public list<case> caseList2ndLine{get;set;}
    public list<case> caseList3rdLine{get;set;}
    public case caseList1stLinePrevious{get;set;}
    public case caseList2ndLinePrevious{get;set;}
    public case caseList3rdLinePrevious{get;set;}

    public ITSSDashboardController()
    {
          getCases();
    }
    
  
    
    public PageReference getCases()
    {

            caseList1stLine = new list<case>();
            caseList2ndLine = new list<case>();
            caseList3rdLine = new list<case>();
            caseList1stLinePrevious = new case();
            caseList2ndLinePrevious = new case();
            caseList3rdLinePrevious = new case();
            
            caseList1stLine=[SELECT CaseNumber, SuppliedEmail, Day_Created__c,Days_Open__c, Subject FROM Case WHERE Owner.Type = 'Queue' AND Owner.Name = 'IT First Line' ORDER BY CreatedDate DESC];
           
            caseList2ndLine=[SELECT CaseNumber, SuppliedEmail, Day_Created__c,Days_Open__c, Subject FROM Case WHERE Owner.Type = 'Queue' AND Owner.Name = 'IT Second Line' ORDER BY CreatedDate DESC];
            
            caseList3rdLine=[SELECT CaseNumber, SuppliedEmail, Day_Created__c,Days_Open__c, Subject FROM Case WHERE Owner.Type = 'Queue' AND Owner.Name = 'IT Third Line' ORDER BY CreatedDate DESC];
           
            
           
            if(caseList1stLinePrevious.Subject != caseList1stLine[0].Subject  )
            {
  caseList1stLinePrevious.Subject = caseList1stLine[0].Subject;
                caseList2ndLinePrevious.Subject = caseList2ndLine[0].Subject;
                caseList3rdLinePrevious.Subject = caseList3rdLine[0].Subject;           
    // DOES NOT EVALUATE TO TRUE?
            }
      
     
        return null;
        
    }

}


But it doesn't work. How do I store new cases and then make a condition evaluate to true if it's actually a new case?


Thanks.