function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JanitaB2JanitaB2 

Autocomplete not working on custom page

I have overriden the New Task page with a custom VF page and Controller Extension.  When I implemented this, autocompletion on Subject stopped working in IE 8, which all my users have.  (It still works in Firefox and Chrome, but they are not allowed to use those.)  We need the standard autocompletion, not anything fancy.  Autocomplete still works on Subject on the Edit Task page, and on other pages, so it is not a browser setting.  (Though I did research all those.)

 

Anyone else have this problem?  Or do you see anything wrong in the code?

 

All help much appreciated!!

 

The code follows:

<apex:page id="thePage" standardController="Task" extensions="AddTaskExtension">
  <apex:form id="theForm">
     <apex:pageBlock title="Create new Task" id="theBlock">
        <apex:pageBlockButtons >                 
            <apex:commandButton action="{!Save}" value="Save"  /> 
            <apex:commandButton action="{!Cancel}" value="Cancel" />
        </apex:pageBlockButtons>
        <apex:pageMessages />
        <apex:actionStatus id="workStatus" startText=" working..." stopText=""/>   
        <apex:actionRegion > 
          <apex:pageBlockSection title="Task Info" columns="2">
             <apex:inputField value="{!task.Subject}" />
             <apex:inputField value="{!task.OwnerId}" />
             <apex:pageBlockSectionItem > 
               <apex:outputLabel value="Type"/>
               <apex:outputPanel > 
                 <apex:inputField value="{!task.Type}" >
                     <apex:actionSupport event="onchange" rerender="theBlock" status="tStatus"/>
                 </apex:inputField>
                 <apex:actionStatus startText="working... " id="tStatus" />
             </apex:outputPanel>
             </apex:pageBlockSectionItem>
             <apex:inputField value="{!task.WhatId}" />
             <apex:inputField value="{!task.ActivityDate}" />
             <apex:inputField value="{!task.WhoId}" />
             <apex:inputField value="{!task.Priority}" />
             <apex:inputField value="{!task.Log_a_Call__c}" />
             <apex:inputField value="{!task.Status}" />
             <apex:inputField value="{!task.Control_Center_Offered__c}" />
             <apex:inputField value="{!task.Send_to_Legacy_Systems__c}" />
          </apex:pageBlockSection>
          <apex:pageBlockSection columns="1" >
             <apex:inputTextarea value="{!task.Description}" label="Comments" cols="100" rows="8"/>
             <apex:inputField value="{!task.Send_Summary_to_Legacy__c}" />
             <apex:inputTextarea value="{!task.ActivitySummary__c}" cols="100" rows="3"/>
          </apex:pageBlockSection>
          <apex:pageBlockSection title="Payment Info" columns="1" rendered="{!task.Type == 'Payment' || task.Type == 'Promise to Pay' }">
             <apex:inputField value="{!task.Promised_Payment_Date__c}" />
             <apex:inputField value="{!task.Payment_Type__c}" />
             <apex:inputField value="{!task.Promised_Payment_Amount__c}" />
             <apex:inputField value="{!task.Internal_PTP__c}" />
          </apex:pageBlockSection>
          <apex:pageBlockSection title="Payment Investigation Info" columns="1" rendered="{!task.Type == 'Misapplied Payment Research'}">
             <apex:inputField value="{!task.PI_by_Collector__c}" />
             <apex:inputField value="{!task.PI_Sent_to_RPS__c}" />
             <apex:inputField value="{!task.Payment_Investigation_Amount__c}" />
          </apex:pageBlockSection>
          <apex:pageBlockSection title="Pending Adjustment Info" columns="1" rendered="{!task.Type == 'Pending Adjustment'|| task.Type =='Dispute'}">
             <apex:inputField value="{!task.Pending_Adjustment_Amount__c}" />
          </apex:pageBlockSection>
          <apex:pageBlockSection title="Write-off Info" columns="1" rendered="{!task.Type == 'Write-off'}">
             <apex:inputField value="{!task.Write_off_Amount__c}" />
             <apex:inputField value="{!task.Write_off_Reason__c}" />
          </apex:pageBlockSection>
        </apex:actionRegion>
     </apex:pageBlock> 
   </apex:form>         
</apex:page>

public class AddTaskExtension {
   private Task task;
   public String RelatedType { get; set; }
   
   public AddTaskExtension(ApexPages.StandardController stdController) {
      this.task = (Task)stdController.getRecord();
      task.ownerId = UserInfo.getUserId();
      
      Id passedWhoId = ApexPages.currentPage().getParameters().get('who_id'); 
      if ( passedWhoId != null ) {
          try {
             Contact result = [ Select Id from Contact where id = :passedWhoId ]; 
             task.WhoId = passedWhoId ;
          }
          catch (QueryException e) {
             task.WhoId = null;
          }
      }   

      String passedSubject = ApexPages.currentPage().getParameters().get('tsk5'); 
      if ( passedSubject != null ) {
             task.Subject = passedSubject ;
      }   

   }
   
   public PageReference save() {
   
       if (task.ActivityDate == null) {
           task.ActivityDate = System.Today();
       }
   
       if ((task.Send_Summary_to_Legacy__c || task.Send_to_Legacy_Systems__c) && task.WhatId == null ) {
            task.Send_Summary_to_Legacy__c = false;
            task.Send_to_Legacy_Systems__c = false;
       }
       try {
          insert task;
          // begin logic to add a Legacy Note if only 1 billing account 
          PageReference p;
          if (task.WhatId != null && (task.Send_Summary_to_Legacy__c || task.Send_to_Legacy_Systems__c)) {
             Task mytask = [Select WhatId, What.Type from Task where id = :task.Id];
             if (mytask.what.type != null ) 
                 //ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'What type: '+ task.what.type));        
                 RelatedType = mytask.What.Type; 
             else 
                 RelatedType = 'No What'; 
              
             if (RelatedType == 'Case' || RelatedType == 'Account' || RelatedType == 'Billing_Account__c') { 
                String result = CountBAforTask.CountBAs(task.Id); 
                if (result.substring(0,2) == 'OK') { 
                    p = new PageReference('/apex/SelectBillingAcctForNote?id=' + task.Id);
                    return p;
                }
             }
          }

          p = new PageReference('/' + task.Id);
          return p;

       } catch (DMLException ex) {
          return null;  
       } catch (Exception e) {
          ApexPages.addMessages(e);
          return null;  
       }         
  
  }
}