• BaLab2a
  • NEWBIE
  • 24 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 11
    Replies

I'm getting the error "Return type of an Apex action method must be a PageReference. Found: core.apexpages.el.ApexELResolver$VisualforceArrayList"

 

What is the issue?

 

 

/**Visual page **/

 

<apex:page standardController="Applicant__c" recordSetVar="applicant" extensions="view">
  <apex:form >
      <apex:pageBlock >
          <apex:outputLabel value="Status :" for="status"/>
          <apex:inputField id="status" value="{!Applicant__c.Status__c}">
          <apex:actionSupport event="onchange" action="{!getApplicantByStatus}" reRender="view"/>
              <apex:param name="para" value="{!Applicant__c.Status__c}" assignTo="{!para}"/>
             
            
          </apex:inputField>
      
      </apex:pageBlock>
       <apex:pageBlock >
           <apex:panelgroup id="view">
              <apex:pageBlockTable id="viewApplicant" value="{!applicantByStatus}" var="app">
                  <apex:column headerValue="Applicant ID" value="{!app.Name}">
                              
                  </apex:column>
                  <!-- <apex:column headerValue="Applicant Name" value="{!app.Name__c}">
              
                  </apex:column>-->
              </apex:pageBlockTable>
           </apex:panelgroup>
      </apex:pageBlock> 
      
  </apex:form>
</apex:page>

 /**Controller code**/

 

public class view {

    public Applicant__c applicant;
    public List<Applicant__c> applicantByStatus {get;set;}
    private ApexPages.StandardSetController controller;
   
    public List<String> applicantNameByStatus{get;set;}
    
    public String para{
        get;
        
        set{
           para=value;
        
        }
    }
    
    public List<String> displayFields {
        get; private set;
    }
    
    public view(ApexPages.StandardSetController controller) {
        this.applicant=(Applicant__c)controller.getRecord();
        //this.controller = controller;
    }
    
    public List<Applicant__C> getApplicantByStatus(){
        
         applicantByStatus=new List<Applicant__c>();
         applicantByStatus=[SELECT Name,Name__c,Status__c,Interview_Date_Time__c FROM Applicant__c WHERE Status__c =:para];
         
         if(applicantByStatus==null){
             System.Debug('APPLICANT STATUS IS NULL');
         }
         for(Applicant__c app:applicantByStatus){
             String name=app.Name__c;
             System.Debug('CHECK :: '+app.Name__c);
             applicantNameByStatus.add('app.Name__c');
         }
         
         //applicantNameByStatus.add('Chamil');
          //applicantNameByStatus.add('madusanka');
          // applicantNameByStatus.add('applicant1');
         
         return applicantByStatus;
    } 
}

 

 

 

Hi,

 

I need to integrate facebook with Salesforce  without using Faceforce connector.

please provide any ideas or URL to implement this..

 

thanks,

Bala

  • September 05, 2011
  • Like
  • 0

Hi Friends,

 

Please give me some useful guide and tips regarding  Salesforce Administrator Certification.

 

 

Thanks in Advance

 

Thanks,

BaLa



Hi Friends,

 

Please give me some useful guide and tips regarding  Salesforce Developer Certification.

 

 

Thanks in Advance

 

Thanks,

BaLa

Hi all,

 i have used the following code to retrieve StandardObjectFields however  LookUp fields are missing.. advance thanx for your Suggestions,,

 

 

 

sObject s = new Lead();
Schema.DescribeSObjectResult r = Lead.sObjectType.getDescribe();
Map<String, Schema.SObjectField> M = Schema.SObjectType.Lead.fields.getMap();
LQResults = new List<LeadQueryResults>();
    for(Schema.SObjectField sf : M.values())
    {
    LeadQueryResults myobject = new LeadQueryResults();
    myobject.isChecked = false;
    myobject.Leadname = sf.getDescribe().Label;
    LQResults.Add(myobject);
    }
}

 

 

 

Thnx.

  • September 27, 2010
  • Like
  • 0

Hello friends

 

I am new to salesforce and i am having confusion about how to use outbound messages in workflow or approval process.Please guide me to proper place or send me link of .pdf in which examples are there for outbound messages.

Any help would be appreciated.

 

Thanks

Hi, I am learning salesforce and apex coding, and got some problems.

 

For example, code like this: (The function is, Tag the record with latest date "Most Recent Record", and other record not tagged.)

 

 

------------------------------------------------------------------------------------------------------------------------

trigger LatestEvaluationHistory on Evaluation_History__c (after delete, after insert, after update) {
        
        List<Evaluation_History__c> ctxsToUpdate = new List<Evaluation_History__c>{};    
        Set<Id> emtoupdate = new Set<Id> ();
        boolean firstRecord = true;    
        
        if (Trigger.isInsert || Trigger.isUpdate ) {
            for (Evaluation_History__c c: Trigger.New) {
                emtoupdate.add(c.Job_Name__c);
            }
        }
        
        else {
            for (Evaluation_History__c c: Trigger.Old) {
                emtoupdate.add(c.Job_Name__c);
            }
        }
        
        if(ctxsToUpdate != null && !ctxsToUpdate.IsEmpty())
        {
        for(Evaluation_History__c ctx : [Select Id, Most_Recent_Record__c, Effective_Date__c
            from Evaluation_History__c where Job_Name__c =: emtoupdate ORDER BY Effective_Date__c DESC])
            {
                if(firstRecord)
                {
                    ctx.Most_Recent_Record__c = True;
                    firstRecord = false;    //System.debug(LoggingLevel.INFO,'a'+ctx.Id);
                }
                else
                {
                    ctx.Most_Recent_Record__c = False;    //System.debug(LoggingLevel.INFO,'b'+ctx.Id);
                }
                    
                ctxsToUpdate.add(ctx);
            }
        
        update ctxsToUpdate;
        }
}

------------------------------------------------------------------------------------------------------------------------

 

This code can work in Sandbox, but cannot deploy into production because the test coverage is 0%.

So Who can teach me how to increase the test coverage???

 

Thanks a lot.

I am really torturing in this part.

 

Hi,

 

Currently i am using free developer edition of salesforce and I still write this code on Visualforce Page:

<apex:page controller="leadLookupController">
<apex:form >
    <apex:outputLabel value="Email" />:
    <apex:outputLabel value="{!SearchString}" /><br/>
    <apex:outputLabel value="Street" />:
    <apex:outputLabel value="{!Lead.street}" /><br/>
    <apex:outputLabel value="City" />:
    <apex:outputLabel value="{!Lead.city}" /><br/>
    <apex:outputLabel value="State" />:
    <apex:outputLabel value="{!Lead.state}" /><br/>
    <apex:outputLabel value="Zip" />:
    <apex:outputLabel value="{!Lead.postalcode}" /><br/>
</apex:form>
</apex:page>

 

But I want to see this code as normal page(design view). I dont have any clue that how can I see this code on that and I already dont have any tab/option in my developer edition login.

 

Please help any one. It is very important for me.

 

Thanks and regards,

Jeetu Gupta

Hi,

 

I guess this is a simple one.

 

When selecting Stage=WON i would like to get an error message if the Account selected is an specific one: ACME

 

Thank you

In my Visualforce page I'm using a standardController with the extensions=""

 

The Visualforce page is used as a custom List Button which allows users to select multiple records in an enhanced list.

 

I have a command button that is supposed to call a method, but for some reason, the method never gets fired.

 

Have set up some debug logs to see if there is any data at all, and nothing comes up in the debug. Any ideas on why this command won't fire properly would be appreciated.

 

<apex:page standardController="pse__Timecard__c" 
                   extensions="TimecardSplitButtons" 
                 recordSetVar="tcSplits">
    <apex:pageMessages />
    <apex:form >
        <apex:commandButton action="{!UnholdForBilling}" value="Unhold for Billing"/>
    </apex:form>
</apex:page>


public with sharing class TimecardSplitButtons {

    private ApexPages.StandardSetController ssc;

    // Local Variables
    public List<pse__Timecard__c> tcIds = new List<pse__Timecard__c>();

    // Constructor
    public TimecardSplitButtons(ApexPages.StandardSetController ssc) {
        this.ssc = ssc;
    }

    public void UnholdForBilling() {
        this.tcIds = this.ssc.getRecords();
        System.debug('3 - ' + this.tcIds.size());
        if (this.tcIds.size() > 0) {
            List<pse__Timecard__c> tcsValidate = [SELECT Id, pse__Timecard_Header__c,
                                                         pse__Timecard_Header__r.pse__Project__r.Id, pse__Timecard_Header__r.pse__Project__r.pse__Closed_for_Time_Entry__c,
                                                         pse__Timecard_Header__r.pse__Assignment__r.Id, pse__Timecard_Header__r.pse__Assignment__r.pse__Closed_for_Time_Entry__c
                                                    FROM pse__Timecard__c
                                                   WHERE Id IN :this.tcIds AND
                                                         pse__Billable__c = true AND
                                                         pse__Billed__c = false AND
                                                         pse__Approved__c = true AND
                                                         pse__Invoiced__c = false AND
                                                         pse__Total_Billable_Amount__c > 0];
            
...
...
...
        }
    }

}

 

 

 

Hi Friends,

 

Please give me some useful guide and tips regarding  Salesforce Developer Certification.

 

 

Thanks in Advance

 

Thanks,

BaLa

I'm getting the error "Return type of an Apex action method must be a PageReference. Found: core.apexpages.el.ApexELResolver$VisualforceArrayList"

 

What is the issue?

 

 

/**Visual page **/

 

<apex:page standardController="Applicant__c" recordSetVar="applicant" extensions="view">
  <apex:form >
      <apex:pageBlock >
          <apex:outputLabel value="Status :" for="status"/>
          <apex:inputField id="status" value="{!Applicant__c.Status__c}">
          <apex:actionSupport event="onchange" action="{!getApplicantByStatus}" reRender="view"/>
              <apex:param name="para" value="{!Applicant__c.Status__c}" assignTo="{!para}"/>
             
            
          </apex:inputField>
      
      </apex:pageBlock>
       <apex:pageBlock >
           <apex:panelgroup id="view">
              <apex:pageBlockTable id="viewApplicant" value="{!applicantByStatus}" var="app">
                  <apex:column headerValue="Applicant ID" value="{!app.Name}">
                              
                  </apex:column>
                  <!-- <apex:column headerValue="Applicant Name" value="{!app.Name__c}">
              
                  </apex:column>-->
              </apex:pageBlockTable>
           </apex:panelgroup>
      </apex:pageBlock> 
      
  </apex:form>
</apex:page>

 /**Controller code**/

 

public class view {

    public Applicant__c applicant;
    public List<Applicant__c> applicantByStatus {get;set;}
    private ApexPages.StandardSetController controller;
   
    public List<String> applicantNameByStatus{get;set;}
    
    public String para{
        get;
        
        set{
           para=value;
        
        }
    }
    
    public List<String> displayFields {
        get; private set;
    }
    
    public view(ApexPages.StandardSetController controller) {
        this.applicant=(Applicant__c)controller.getRecord();
        //this.controller = controller;
    }
    
    public List<Applicant__C> getApplicantByStatus(){
        
         applicantByStatus=new List<Applicant__c>();
         applicantByStatus=[SELECT Name,Name__c,Status__c,Interview_Date_Time__c FROM Applicant__c WHERE Status__c =:para];
         
         if(applicantByStatus==null){
             System.Debug('APPLICANT STATUS IS NULL');
         }
         for(Applicant__c app:applicantByStatus){
             String name=app.Name__c;
             System.Debug('CHECK :: '+app.Name__c);
             applicantNameByStatus.add('app.Name__c');
         }
         
         //applicantNameByStatus.add('Chamil');
          //applicantNameByStatus.add('madusanka');
          // applicantNameByStatus.add('applicant1');
         
         return applicantByStatus;
    } 
}

 

 

 

what is the difference between "Trigger.New" and "Trigger.old"?

  • December 22, 2010
  • Like
  • 0

What is outbound message? What is the need of outbound message (Workflow) in salesforce?

 

Please reply......

 

 

Regards:

VVNRAO

  • November 23, 2010
  • Like
  • 0

Hi all,

 i have used the following code to retrieve StandardObjectFields however  LookUp fields are missing.. advance thanx for your Suggestions,,

 

 

 

sObject s = new Lead();
Schema.DescribeSObjectResult r = Lead.sObjectType.getDescribe();
Map<String, Schema.SObjectField> M = Schema.SObjectType.Lead.fields.getMap();
LQResults = new List<LeadQueryResults>();
    for(Schema.SObjectField sf : M.values())
    {
    LeadQueryResults myobject = new LeadQueryResults();
    myobject.isChecked = false;
    myobject.Leadname = sf.getDescribe().Label;
    LQResults.Add(myobject);
    }
}

 

 

 

Thnx.

  • September 27, 2010
  • Like
  • 0