• JAYESH RATHOR
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies
When Cases are attached to a knowledge article
  • How to get case count in trigger.
  • So based on case count I want to perform my bussiness logic
Please just any solution if you can suggest....urgent.

Thanks in advance.
Here THIS_Month is a pick list value.
If(selectvalue =='THIS_Month')
{
List<AggregateResult> openCaseList=  [SELECT Count(id),Status from Case Where RecordType.Name !='Return Case'  AND  CreatedDate  <= THIS_MONTH Group By Status LIMIT 49999];
}
But I am getting Too many query rows: 50001 
please give me any solution on it.
public pagereference redirectLater(){
        pagereference pgRd;
        try{
            pgRd = new pagereference('/Save_Page?lang='+ApexPages.currentPage().getParameters().get('lang'));
            pgRd.setRedirect(true);
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));
            return null;
        }     
        return pgRd;    
    }
 
public with sharing class Support_Footer_Controller {
    public List<Language_Codes__c> langCodeList = new List<Language_Codes__c>();
    public map<string, string> langCodeURLMap = new map<string, string>();
    //Default Constructor
    public Support_Footer_Controller(){
    }
    //Function to redirect contact support page
    public pagereference redirectToContactSupport(){
        try{
            //Get language code and URL parameters from custom setting
            langCodeList = Language_Codes__c.getAll().values();
            for(Language_Codes__c lang : langCodeList){
                langCodeURLMap.put(lang.language_code__c, lang.language_URL__c);
            }
            String userLanguage = ApexPages.currentPage().getParameters().get('lang');
            if(langCodeURLMap.get(userLanguage) != null){
                userLanguage = langCodeURLMap.get(userLanguage);
            }
            //Redirect to contact support page 
            pagereference pg = new pagereference(System.Label.url1+userLanguage+System.Label.url2);
            system.debug('userLanguage=='+userLanguage);
            pg.setRedirect(true);
            return pg;
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));
            return null;
        }

    }
}
When Cases are attached to a knowledge article
  • How to get case count in trigger.
  • So based on case count I want to perform my bussiness logic
Please just any solution if you can suggest....urgent.

Thanks in advance.
Here THIS_Month is a pick list value.
If(selectvalue =='THIS_Month')
{
List<AggregateResult> openCaseList=  [SELECT Count(id),Status from Case Where RecordType.Name !='Return Case'  AND  CreatedDate  <= THIS_MONTH Group By Status LIMIT 49999];
}
But I am getting Too many query rows: 50001 
please give me any solution on it.
public pagereference redirectLater(){
        pagereference pgRd;
        try{
            pgRd = new pagereference('/Save_Page?lang='+ApexPages.currentPage().getParameters().get('lang'));
            pgRd.setRedirect(true);
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));
            return null;
        }     
        return pgRd;    
    }
 
public with sharing class Support_Footer_Controller {
    public List<Language_Codes__c> langCodeList = new List<Language_Codes__c>();
    public map<string, string> langCodeURLMap = new map<string, string>();
    //Default Constructor
    public Support_Footer_Controller(){
    }
    //Function to redirect contact support page
    public pagereference redirectToContactSupport(){
        try{
            //Get language code and URL parameters from custom setting
            langCodeList = Language_Codes__c.getAll().values();
            for(Language_Codes__c lang : langCodeList){
                langCodeURLMap.put(lang.language_code__c, lang.language_URL__c);
            }
            String userLanguage = ApexPages.currentPage().getParameters().get('lang');
            if(langCodeURLMap.get(userLanguage) != null){
                userLanguage = langCodeURLMap.get(userLanguage);
            }
            //Redirect to contact support page 
            pagereference pg = new pagereference(System.Label.url1+userLanguage+System.Label.url2);
            system.debug('userLanguage=='+userLanguage);
            pg.setRedirect(true);
            return pg;
        }
        catch(Exception e){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));
            return null;
        }

    }
}