• raseshtcs
  • NEWBIE
  • 288 Points
  • Member since 2009

  • Chatter
    Feed
  • 9
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 156
    Replies

I have a date filed(Datefiled12) which is displayed in Visualforce page and a formula filed(Updatedate) of datetype "date", whenever Datefiled12  is changed on visual force page then  Updatedate has to updated  with value equal to  Datefiled12 +4 days.

 

 

EG:

when user select the below value on visualforce page

Datefiled12  = 1/5/2012

 

then Updatedate = 1/9/2012

 

Can it be possible on page level without any button click?

 

  • January 05, 2012
  • Like
  • 0

Hi,

 

Can someone guide us like how can we remove the timestamp from the DateField Value.

 

Ex: Suppose i have Date value like 2011-11-15 00:00:00 then i want to print only 2011-11-15.

 

Please share your thoughts on this.

 

Regards

G. Surender

Hi All,

 

I want to know how can I query for Users having a particular profile permission sets in an Apex class. I am doing following query:

 

SELECT PermissionSetId FROM PermissionSetAssignment WHERE AssigneeId= :UserInfo.getUserId() AND PermissionSet.Name = 'EntityFasadUser'

 

There is an compilation error as below:

Save error: sObject type 'PermissionSetAssignment' is not supported.

 

Please help me on this. Thanks in advance.

 

Regards,

Lakshman

Hello everyone,

 

I've developed a VF Page where I want to show several options in a column. But, instead of that, the options are in a row. This is the code:

 

<apex:form >

<apex:selectCheckboxes value="{!Products}" title="Choose Five!!">           

<apex:selectOptions value="{!items}"/><br/>     

</apex:selectCheckboxes><br/>

</apex:form >

 

Any advice would be most welcome!

 

Regards

  • November 02, 2011
  • Like
  • 0

Hi

 

I have written a trigger

 

trigger oneTimeTrigger on Account (after insert, after update) {
    Account myAcc = trigger.new[0];
    Account[] accs = [SELECT Id, Name FROM Account];
    list<Account> accList = new list<Account>();
    integer count = 0; 
    if(accs.size() > 0) {
        for(Account a : accs){
            count++;
            if(count >= 0 && count <= 500) {
                Opportunity[] opp = [select Id From Opportunity where AccountId = :a.Id];
                if(opp != null) {
                    a.Number_Of_Opportunities__c = opp.size(); // count();
                    accList.add(a);
                }
            }
        }
        update accList;
    }

}

 

But i am getting a Error

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger oneTimeTrigger caused an unexpected exception, contact your administrator: oneTimeTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 001L00000033S7PIAU; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, oneTimeTrigger: maximum trigger depth exceeded Account trigger event AfterUpdate for [001L00000033S0b] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event AfterUpdate for [001L00000033S0b, 001L00000033S7P] Account trigger event BeforeUpdate for [001L00000033S0b, 001L00000033S7P]: []: Trigger.oneTimeTrigger: line 17, column 9

 

Why is this happening? Please help

 

Thanks and Regards

Hari  G S

Hi, I am new to Apex and have been working on developing a few triggers that will create a new Task based on specific criteria.  The trigger will only fire after some sort of update on the record.  I have been able to successfully write the trigger but the issue I am having is how to write it so it only fires once.  Below is the trigger I wrote.  Any help in how to change it so that it only fires once would be greatly appreciated.  Thank you!

 

trigger ARGOCoverageLetterTask on Claim__c (after update) {
Claim__c SO=Trigger.new[0];
if (SO.Name == 'ARGO*'){
Task argoCoverageTask = new Task();
argoCoverageTask.ActivityDate = SO.LVL_Received_Date__c + 30;   
argoCoverageTask.WhatId = SO.id;
argoCoverageTask.OwnerId = SO.Assigned_Examiner2__c;   
argoCoverageTask.Priority = 'Normal';   
argoCoverageTask.Status = 'Not Started';   
argoCoverageTask.Subject = 'Coverage Letter';   
Insert argoCoverageTask;
}// else nothing
}



  • October 24, 2011
  • Like
  • 0

Hi

Please tell me what is the use of limit in qures.

 

Have written the code like this

 Timecard_Base__c timebase = new Timecard_Base__c();
      timebase  = [select WeekStartdate__c from Timecard_Base__c ];

 then i got error that

 

System.QueryException: List has more than 1 row for assignment to SObject 
Class.NigiController.retrive: line 10, column 19 External entry point

 

but when i changed code to

Timecard_Base__c timebase = new Timecard_Base__c();
      timebase  = [select WeekStartdate__c from Timecard_Base__c limit 1];

 i am only getting 1 value i want all the values. Please help me .

thanks

Anuraj

 

  • September 27, 2011
  • Like
  • 0

Can anyone share sample code to create a task based on a custom field on an Account record?  I believe I'm making my code way too difficult.

 

 

Hey all, does anyone know how to create a new object from a button? i have a VF page with a button and i need to click the button then see the custom objects page layout in edit mode ... does that make sense? but im a but stuck how to do it, would i need to created the object insert it and then redirect the user or is there a nicer way to do it?

 

Cheers All

 

  • September 12, 2011
  • Like
  • 0

I have a query regarding the licenses. If I buy the force.com 15$ edition, do I get the rest of the user licenses like authenticated website and platform users free with 15 $ or I have to pay 15 $ for each user every month.

 

Thanks in advance

I am not able to access any of the reports via my customer portal user. I have made the folder and the object and the report accessible to the portal users. I think I know the problem, but just dont know how to solve it. The problem seems to be the "Run Report" Permission which is missing from the profile of the customer portal user. I have cloned the standard authenticted website user profile, but I am not able to find the permission. I also tried to add a permission set, but the permission set also does not show the run report or export report permission.

 

Thanks in advance!!

Hello,

 

I have a page block table which has an input text in one column, another column contains information which i fetch from db depending on the user input in the input text field. I am doing this using onblur and action function. What I want to do is to show a loading image in the specific cell for which user has input his data. Right now i am able to show a loading image but it is on the entire page, I would like that the image to be on the specific cell on which the data would come once fetched.

 

Thanks in advance.

 

I have a page block table with a number of columns, The first is an input text where the user would enter id of a record, in the next two columns i want to fetch record information of the id entered by the user. I am trying to do this on blur using action support. below is the code

PAGE

<apex:pageBlockTable id="bodyTable" value="{!Records}" var="acc" rowClasses="odd,even" styleClass="tableClass" cellpadding="" cellspacing="" align="center">
                <apex:column style="text-align:center;">
                    <apex:facet name="header">Number</apex:facet>
                    <apex:outputPanel >
                        <apex:inputText value="{!acc.no}">
                        <apex:actionSupport event="onblur" action="{!getInfo}" reRender="bodyTable" status="counterStatus">
                        <apex:param name="seno" value="{!acc.no}"/>
                        </apex:actionSupport>
                        </apex:inputText>
                    </apex:outputPanel>
                    <apex:actionStatus id="counterStatus" startText="Fetching.." stopText=""/>
                </apex:column>

then there are rest of the colums

 In the Class if I am trying to acces what the user entered in the text box, it gives me null

    public PageReference getInfo(){
        String sNumber = ApexPages.currentPage().getParameters().get('no');
        system.debug('GET INFO CALLED'+sNumber);
        return null;
    }

 Any clues where i might be wrong

Hi,

 

I am trying to populate a list of custom object. I am querying 4-5 fields and then adding the results to a list. On doing a system.debug of the list,the list does not contain all the fields which i did put in the query. All this is happening in a trigger. When I am doing the same thing directly in the system log, it works just fine. I have checked for the field level securities of the fields i am querying.

 

Please let me know where I am going wrong...

 

Thanks in advance.

Public class utility{
    @future
    public static void updatehmt(List<customobject__c> colist){
        Update colist;
    }
}

 When I try to save the above class it doesnt save and gives error Unsupported parameter type LIST<customobject__c> at line 5 column 24

If I change the parameter to a set of ids the class gets saved. Any idea what am I doing wrong??

I have created a Visualforce page and am using it through a site. When I right click on the browser and click on view source I am able to see the entire code of my controller class. Is there any way to hide that.

I today noticed a link right besides the Salesforce logo in the top left corner of the page which said skip to main content. On click the link redirects to the same page. I am not able to reproduce the link but it sure is present in the HTML of the page.

Any clues what is it??

Hey I am facing a view state error. I checked in the view state option and it shows that the query which i use returns around 2500 records which jump the limit of 135 Kb. are there any workarounds other that putting a limit on the query.

Hi,
I am using the below code to display a gif stored as a static resource to display the status of an AJAX update request. I want that the image be displayed in the middle of the page and the main page be unusable for that time.

<apex:page controller="exampleCon">
    <apex:form >
        <apex:outputText value="Watch this counter: {!count}" id="counter"/>
        <apex:actionStatus id="counterStatus" style="align:center;" >
            <apex:facet name="start" >
            <apex:image url="{!$Resource.loading}" height="50" width="50" />                       
        </apex:facet>
        </apex:actionStatus>
        <apex:commandButton action="{!incrementCounter}" title="Click Me" rerender="counter"
            status="counterStatus"/> 
    </apex:form>
</apex:page>

 Class:

public Global class exampleCon {

Integer count = 0;
public PageReference incrementCounter() {
count++;
return null;
}
public Integer getCount() {
return count;
}
}

 Thanks in advance!!

I have an object which has certain set of records with some fields. Now the user uploads a set of records using excel with certain changes to the fields of the existing record. I want to show one by one all the records to which changes were made, with the old and the new values infront of one another. Allowing the user to confirm the changes and only then commit to the actual database. I am planning to hold the uploaded data in another object and update the original object only on  click of approve on the comparison page.

 

Thanks in advance.

Hi All,

 

I have created a List button on a custom Object with label Account and api name Account__c. The list button should create a record of another custom object and then redirect the user to create page of another object.

But on click of the button java script throws an error. DUPLICATE PREFIX : ACCOUNT

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/19.0/apex.js")}

var cId= '{!Account__c.Id}';
var Org_Constant__c=new sforce.SObject("Org_Constant__c");
Org_Constant__c.Id__c = cId;
Org_Constant__c.Object_Type__c = 'Account';
Org_Constant__c.UserId__c = '{!$User.Id}';

var result = sforce.connection.create([Org_Constant__c]);

if (result[0].getBoolean("success"))
top.location.href = '/a07/e';
else
alert("Operation Failed " + result[0]);

 

The same logic needs to work for 3 more custom objects for which I have created the button and it is working fine. I also tried to write just an alert statement on click of the button, but I am getting the same error.

Please Suggest.

 

Alternatively I thought of creating a VF page to override the button instead of Javascript, but I am not getting the my VF page in the list there. Am I missing something there.

 

Thanks in Advance.

Rasesh

Hi,

I have overridden new and edit of a custom object with a VF page which allows the user to search and then insert records to the custom object. What I want to do is when a user clicks edit infront of the record from the related list, the fields of the object get auto populated in the search fields of my VF page. I was trying to pass parameters (as we normally do in case we need opportunity name to be defaulted with some value) through URL but it is not working is there another way to do the same.

 

Thanks in advance 

Rasesh

Hi,

I have created an unmanaged package in my sandbox. While adding components to the package, i dont see the Apex Triggers that I have created on custom Objects. Triggers on Standard Objects are available to be added to the package. Am I missing something here. Please suggest.

 

Thanks

Hi,
Is there any way to provide the ability to sync sent emails from CRM to Outlook and Outlook to CRM.
Thanks in Advance
Rasesh

Hi All,

My requirement is to automate the name of the opportunity in the following format Account Name-"{Custom Field}". If multiple Opportunities exist for the same Account and the custom field value, the Opportunity Name should reflect that iteration (e.g. "Account1 - xyz", "Account1 - xyz(2)", "Account1 - xyz(3)", etc).

I have written a trigger which populates the name properly but I am struggling with the Iteration number which I need to have. Please suggest.

 

Thanks in Advance

Rasesh

Hi All,

 

Is there a way to override the new button of account with a visualforce page and then provide a link/button on the page itself which redirects the user to the stabndard create page of the account without the override.

What I need to do is to make account search mandatory before creation. User is redirected to a search page on click of new, now if the user feels that the account is not present in the system he/she should be able to click on a link to create page of account.

 

Thanks in Advance

Rasesh

Can we create a user record but not send out a password yet still have them log on through single sign on? Or do they need to have logged on at least once before they can use single sign on

Hi,
I am using the below code to display a gif stored as a static resource to display the status of an AJAX update request. I want that the image be displayed in the middle of the page and the main page be unusable for that time.

<apex:page controller="exampleCon">
    <apex:form >
        <apex:outputText value="Watch this counter: {!count}" id="counter"/>
        <apex:actionStatus id="counterStatus" style="align:center;" >
            <apex:facet name="start" >
            <apex:image url="{!$Resource.loading}" height="50" width="50" />                       
        </apex:facet>
        </apex:actionStatus>
        <apex:commandButton action="{!incrementCounter}" title="Click Me" rerender="counter"
            status="counterStatus"/> 
    </apex:form>
</apex:page>

 Class:

public Global class exampleCon {

Integer count = 0;
public PageReference incrementCounter() {
count++;
return null;
}
public Integer getCount() {
return count;
}
}

 Thanks in advance!!

I'm new to triggers and apex and am attempting to automatically set the Opportunity Owner based on the user who converts the lead to an opportunity.  I've tried several different things but have been unsuccessful thus far.

 

//This gives me an error because opp.CreatedById is null and the Opp.OwnerID cannot be set to a null value
//This works when setting it to a default value which i've currently commented out but that doesn't accomplish what i'm trying to do
trigger setOpportunityOwner on Opportunity (before insert) {
   for (Opportunity opp : trigger.new) {

           if (Opp.OwnerID != Opp.CreatedById) {
           //Opp.OwnerID = '005i0000000ZZbh';
          Opp.OwnerID = Opp.CreatedById;
          }
     }
}

 

 

Assuming that this needs to be done after the insert i've taken a different approach and this doesn't give me an error but it doesn't seem to work either.

 

Trigger setOpportunityOwner on Opportunity (after insert) {
    for (Opportunity opp : trigger.new) {
    
            if (Opp.OwnerID != Opp.CreatedById) {
                 Opp.OwnerID = Opp.CreatedById;
            }
        }
    }

 

 

Can someone please offer any advice?

 

Thanks,

 

Hi,

 

I am getting an error on a trigger .

 

I am posting the trigger here

 

Can someone help me please.

 

trigger rollupreferred3OpenAct on Account (before insert, before update) {
    
    if(trigger.isinsert) {
        for( Account ac:trigger.new)
            ac.Open_Actitvities_By_Referred_3__c = 0;
    }
    

else
    if(trigger.isupdate) { 
                 for( Account aci:trigger.new)
        
        for(Account ac : [select a.id, a.Referred_To_3__c, ( Select t.id from Tasks t where ( t.status != 'Completed' ) and ( t.ActivityDate >= Today ) 
        and ( t.OwnerId =: aci.Referred_To_3__c )) from Account a where a.id in :trigger.new])
           

     trigger.newmap.get(ac.id).Open_Actitvities_By_Referred_3__c = ac.Tasks.size();
   

     }
  }

  • March 26, 2013
  • Like
  • 0

hi

I want to know the details of utility class and use of it and how write the class ?

thanks in advance.

  • March 26, 2013
  • Like
  • 0

Hi,

      

     I have a scenario with trigger..........    like when i am updating billing address fields in account  the same should be 

     reflected in contact object fields.

 

     I used after trigger event  but i am getting an error .

 

     help me out in this senario.....

 

thanks

When I update one record, this trigger works, but when I update multiple records by using Apex Dataloader, it doesn't work.

This trigger updates parent object when its child object's status is updated.

 

1. Child object Trigger: it just updates parent object.

trigger RFTSetPDStatusFromMS on Ichthys_RFT__c(after insert, after update) {
    
  if (Trigger.isInsert||Trigger.isUpdate)
  {
    list<Ichthys_RFT__c>msl=[SELECT id,Status__c,RFT_Category__r.Id FROM Ichthys_RFT__c WHERE Id in :Trigger.new];
    Ichthys_RFT__c newMs=null;
    if(msl.size()>0)
    {
      newMs=msl[0]; 
      RFT_Category__c[] pdList = [SELECT id, Name, PD_Status__c FROM RFT_Category__c WHERE Id = :newMs.RFT_Category__r.Id];
      if(pdList.size()>0)
      {
        update pdList[0];
      }
    }
  }
}

2. Parent Object Trigger: it checks child object status and update parent status.

trigger RFTSetPDStatus on RFT_Category__c (before update) {
  if (Trigger.isUpdate)
  {
    List<Ichthys_RFT__c > msList= [SELECT RFT_Category__r.Id,Status__c FROM Ichthys_RFT__c WHERE RFT_Category__r.Id in :Trigger.new];
    Integer msExist=0;
    Integer msCnt=0;  

    if(msList.size()>0){
      msExist +=1;
    }
    for(RFT_Category__c pd:Trigger.new){
      if(msExist==0){
        pd.PD_Status__c ='Open';
      }else{
        for( Ichthys_RFT__c ms :msList){
          if( ms.RFT_Category__r.Id == pd.Id && ms.Status__c <>'Completed' &&  ms.Status__c <>'Not Applicable'){
            msCnt +=1;
          }
        }
        if(msCnt==0){
          pd.PD_Status__c ='Close';
        }
        else if(msCnt>0){
          pd.PD_Status__c ='Open';
        }
      }
    }
  }
}

 Thanks in advance for your help.

 

Anna

 

  • March 26, 2013
  • Like
  • 0

Hey , 

 

I am new to salesforce triggers. I have a look up field on LEAD object called Elite_Partner_Id_gen__c . This is a lookup field to custom object called Elite_Partner_Id__c. I want the value of custom field ( Elite_Id__c) on elite_partner_Id__c object to to get copied to this look up field. Below is the code prepared from various resources. It is not showing any error but it is also not updating the look up field. Any little help will be highly appreciated.

 

trigger updateelitepartnerid on Elite_Partner_Id__c (before insert)
{
List<ID> LeadIds = New List<ID>();

for(Elite_Partner_Id__c partid : Trigger.new)
{
if(partid.Elite_Id__c != null)
{
LeadIds.add(partid.Elite_Id__c);
}
}

 

Map<Id, Lead> leadMap = new Map<Id, Lead>([SELECT Id, Elite_Partner_Id_Gen__c FROM Lead WHERE Id IN :LeadIds]);

 

for(Elite_Partner_Id__c partid : Trigger.new)
{
if(partid.Name != null)
{
Lead Ld = leadMap.get(partId.Elite_Id__c);

Ld.Elite_Partner_Id_Gen__c= partid.Elite_Id__c;

leadMap.put(partId.Elite_Id__c, Ld);
}
}

update leadMap.values();
}

I have been using actionStatus on visualforce pages since a long time but never came across a scenario where the method for which I use it is a PageReference method. AJAX, as far as I understand, is for refreshing a section of a page. In Pagereference, we move to another page, so does it still support actionStatus?

 

I tried this on a simple visualforce page - onclick of a commandbutton I call a PageReference method with Status attribute and it shows me the status but does not redirect.

 

Now, if I remove the status and try clicking on it, it redirects me to the other page.

Is this the expected behaviour or am I missing something here? Please advice.

 

Thanks in advance,

Vishal

Hi All,

 

i have a requirement like this,   mass transfer of account owner names  with filters,  and keep the opportunity owner name same as old opportunity owner name.

 

when am doing mass transfer records, transfering account owner names, transfers all  account owner names to new owner, here my requirement is i need opportunity owner name does't change. 

 

Please guide me, 

 

thanking you in advance

  • March 19, 2013
  • Like
  • 0

here i want all websites names in which front will like www.google.com%

example

www.google.com

or

www.google.com/home

 

 

system.debug('#################query==='+[Select Website_Address__c From Employement_Website__c WHERE Website_Address__c LIKE  :UpdtSiteName+'%'  IN :UpdtSiteName]);

//here UpdtSiteName is a set

 

Hi I want to create one vf page in that i want to show one table with two columns and those are lead owner and ratio of proposed leads by capped leads.

   lead owner                     ratio



proposed is the lead status and capped also lead status .

suppose in a day 10 leads are created in that first owner have  2 are proposed leads and  1 capped lead then we show the ratio of  2/1 for that owner and second owner have 3  proposed leads and 2 capped leads we show the ratio of  3/2 and third owner have 2 proposed leads and 0 capped leads we show the ratio N/A.

      PLZ help me.

Hello Friends,
I am trying to develop a visualforce page in which I am having a page block table
<apex:pageBlockTable value="{!WorkAddList}" var="WrkForecast">
<apex:column headerValue="Date ">
<apex:inputField value="{!Wrkcastt.Date__c}"/>
</apex:column>
<apex:column headerValue="Quantity">
<apex:inputField value="{!Wrkcast.Quantity__c}"/>
</apex:column>
<apex:column headerValue="Revenue">
<apex:inputField value="{!Wrkcast.Revenue__c}"/>
</apex:column>
<apex:column headerValue="Comments">
<apex:inputField value="{!Wrkcast.Comments__c}"/>
</apex:column>
<apex:column headerValue="Product Name">
<apex:outputField value="{!Wrkcast.Product_Name__c}"/>
</apex:column>
</apex:pageBlockTable>
Here wrkcast is my custom object and quote is its parent.here i am having one button named new workschedule in related list of quote which is bringing me on my VF Page.so on click i am creating some rows for wrkcast object for insering the records in wrkcast object.On click on button i want product and revenue should bring the value from quoteline object .
How can I do this?
for(i=0;i<n;i++)
{
WorkcastAddList.add(new Work_Schedule__c());
}
}

  • January 29, 2013
  • Like
  • 0

Where we use (trigger events)  trigger.newmap & trigger.oldmap?

 

I am not able to access any of the reports via my customer portal user. I have made the folder and the object and the report accessible to the portal users. I think I know the problem, but just dont know how to solve it. The problem seems to be the "Run Report" Permission which is missing from the profile of the customer portal user. I have cloned the standard authenticted website user profile, but I am not able to find the permission. I also tried to add a permission set, but the permission set also does not show the run report or export report permission.

 

Thanks in advance!!

Hi folks,

 

I've inherited a series of Visualforce pages and up until yesterday they were working but now all of a sudden I'm getting the following error:

 

Too many query rows: 50001 

 

An unexpected error has occurred. Your development organization has been notified.

 

I've used the Developer Console and it's pin pointed the FATAL_ERROR in the Execution Log to the following method:

 

global class mForceSupportCustCaseRptGeneratorCtrl {

    String customerID;
    String reportMonth;    
    String reportYear;
    
    public PageReference generateReport() {
        PageReference reportPage = Page.mForceSupportCustCaseReport;
        reportPage.setRedirect(true);
        reportPage .getParameters().put('m', reportMonth);
        reportPage .getParameters().put('y',  reportYear);
        reportPage .getParameters().put('acc', customerID);
        return reportPage ;
    }
    
    public List<SelectOption> getListcustomeroptions() {

        List<AggregateResult> customerlist = [Select Account.Name accname, Accountid , count(createddate) FROM Case group by Account.Name, Accountid order by Account.Name limit 25000];

        List<SelectOption> options = new List<SelectOption>();
        
        Map<string,string> accountmap = new Map<string,string>();
        
        for (AggregateResult ar : customerlist ) {
            if (ar.get('expr0')!=null && ar.get('accname')!= null)
                accountmap.put(string.valueof(ar.get('Accountid')),string.valueof(ar.get('accname')));
        }
 
        for(String accid: accountmap.keyset()) {
            options.add(new SelectOption(accid, accountmap.get(accid)));
        }

        return QuickSort.sortOptionList(options);
    }
 
    public String getCustomerID() {
        return customerID;
    }
 
    public void setCustomerID(String customerID) {
        this.customerID = customerID;
    }    

    public List<SelectOption> getlistmonthoptions() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('1', 'January'));
        options.add(new SelectOption('2', 'February'));
        options.add(new SelectOption('3','March'));
        options.add(new SelectOption('4','April'));
        options.add(new SelectOption('5','May'));
        options.add(new SelectOption('6','June'));
        options.add(new SelectOption('7','July'));
        options.add(new SelectOption('8','August'));
        options.add(new SelectOption('9','September'));
        options.add(new SelectOption('10','October'));
        options.add(new SelectOption('11','November'));
        options.add(new SelectOption('12','December'));
        return options;
    }
 
    public String getReportMonth() {
        return reportMonth;
    }
 
    public void setReportMonth(String reportMonth) {
        this.reportMonth= reportMonth;
    }    

    public List<SelectOption> getlistyearoptions() {

        //List<AggregateResult> minmaxdates = [Select MIN(createddate) mindate, MAX(createddate) maxdate FROM Case limit 25000];
        //Integer minyear = datetime.valueof(minmaxdates.get(0).get('mindate')).year();
        //Integer maxyear = datetime.valueof(minmaxdates.get(0).get('maxdate')).year();

        List<SelectOption> options = new List<SelectOption>();
        
        for (Integer i = datetime.now().year() ; i>= 2009 ;i--) {
            options.add(new SelectOption(string.valueof(i),string.valueof(i)));
        }
        return options;
    }
 
    public String getReportYear() {
        return reportMonth;
    }
 
    public void setReportYear (String reportYear) {
        this.reportYear= reportYear;
    }    

}

 Looking at the Execution Log within the Developer Console I can see the (one and only) SOQL statement in the method being executed:

 

List<AggregateResult> customerlist = [Select Account.Name accname, Accountid , count(createddate) FROM Case group by Account.Name, Accountid order by Account.Name limit 25000];

 This obviously has the "limit" keyword on it so should be limiting the resultset, plus in the Developer Console I can see SOQL_EXECUTE_END [18] Rows:105

 

So I'm more than a little confused as to why it thinks the limit has been exceeded and any help would be much appreciated.

 

Thanks,

Martin

 

 

Hi,

 

Please help me with the below scenario, I have Visualforce page through which I can select a value from Picklist and based on the Picklist value particular Checkboxes will be displayed on the page. My Requirment is when a checkbox value is selected and Save botton is clicked, then the checkbox value need to be stored in a TextArea Field in the respective Object.

 

Selected Checkbox values should be displayed in a TextArea Field ' PlacesVisisted__c ' in the Contact Object.

 

Please help me on this scenario. ThankYou.

 

Below is my Visualforce Page.

 

<apex:page standardController="Contact">
<apex:form >
<apex:pageBlock title="Update Contact Details">
 <apex:pageBlockButtons location="bottom">
  <apex:commandButton action="{!save}" value="Save"/>
  <apex:commandButton action="{!cancel}" value="Cancel"/>
 </apex:pageBlockButtons>
<apex:pageBlockSection id="NewPage" title="Select The Country">
    <apex:inputField value="{!Contact.Country__c}">
    <apex:actionSupport event="onchange" reRender="IndiaBlock, USBlock, ChinaBlock, AusesBlock"/>
    </apex:inputField>
    <apex:inputText value="{!Contact.Name}"/>
</apex:pageBlockSection> 
<apex:outputPanel id="IndiaBlock">
 <apex:pageBlockSection rendered="{!Contact.Country__c == 'India'}" id="SampleSendInfoBlock" title="Select Places Visited">
    <apex:inputCheckbox label="Agra"/>
    <apex:inputcheckbox label="Delhi"/>
 </apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel id="USBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'America'}" id="USPageBlock">
  <apex:inputCheckbox label="Newyork"/>
  <apex:inputCheckbox label="Washington"/>
 </apex:pageBlockSection> 
</apex:outputPanel>
<apex:outputPanel id="ChinaBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'China'}" id="ChinaPageBlock">
 <apex:inputCheckbox label="Bejing"/>
 <apex:inputCheckbox label="Taiwan"/>
 </apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel id="AusesBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'Australia'}" id="AusesPageBlock">
 <apex:inputCheckbox label="Sydney"/>
 <apex:inputCheckbox label="Canberra"/>
 </apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>