• RudiHulsbos
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 8
    Replies

Hi All,

 

I have a extension class in my visualforce page, in my class i build a list of records from my custom object when i initialize the controller. I need to limit this list in my test method to ensure i do not exceed the the governer limits, but i just cant seem to figure out how to do it. Please see my code below:

 

public class Recruitement_Dashboard_Controller1{

Public Transient List<Invite_Tracking__c> invitetracking;
    
    Public Recruitement_Dashboard_Controller1(ApexPages.StandardController controller) {
        invitetracking = [SELECT Id,Project__c,Member__c,
Contact__r.Exclude_from_Engagement_Index__c,Contact__r.Member_Invite_Ranking__c,
Contact__r.Region__c,Contact__r.FY_Quarter_Acceptance__c, Counter__c,Organization__r.Operating_Group__c,Organization__r.Client_Classification__c, Organization__r.Id, Organization__r.Global_FT_500_Position__c,
Organization__r.Revenues_Mil_Value__c FROM Invite_Tracking__c WHERE Project__c = 'COO Circle' AND Contact__r.Exclude_from_Engagement_Index__c = FALSE]; system.debug('invitetracking: '+invitetracking); } Public static testMethod void testRecruitement_Dashboard_Controller1() { List<Invite_Tracking__c> invitetracking; PageReference pageref = Page.Recruitment_Dashboard; Test.setCurrentPage(pageRef); Account org = new Account(Name='test'); insert org; Contact con =new Contact (LastName = 'test', AccountId=org.Id, Exclude_from_Engagement_Index__c = FALSE,
Project__c = 'COO Circle'); insert con; Invite_Tracking__c invitetrackinginsert = new Invite_Tracking__c(Contact__c = Con.Id, Organization__c = org.Id ); insert invitetrackinginsert; ApexPages.standardController controller =
new ApexPages.standardController(invitetrackinginsert); Recruitement_Dashboard_Controller1 recruitement =
new Recruitement_Dashboard_Controller1(controller); /*invitetracking = [SELECT Id,Project__c,Member__c,Contact__r.Exclude_from_Engagement_Index__c, Contact__r.Member_Invite_Ranking__c,Contact__r.Region__c,Contact__r.FY_Quarter_Acceptance__c,Counter__c, Organization__r.Operating_Group__c, Organization__r.Client_Classification__c, Organization__r.Id, Organization__r.Global_FT_500_Position__c, Organization__r.Revenues_Mil_Value__c FROM Invite_Tracking__c WHERE Project__c = 'COO Circle' AND Contact__r.Exclude_from_Engagement_Index__c = FALSE limit 100];*/

 I cant seem to figure out how to get the limited list assignment correct in my test method.

 

Any suggestions???

 

Thanks,

 

Rudi


Hi All,

 

I have a visualforce page that displays counts of results. The results are calculated from a list of records, based on a selections from the user. I had to split the controller class into 2 due to the number of characters limitation. In the visualforce page i have controller="Recruitement_Dashboard_Controller1", how do i get the results calculated in the second controller class to display? Please see the code below: (i have posted stripped down examples of my code, i need the returned results of all the methods in both classes, where the data list is generated in the first class)

 

 

public class Recruitement_Dashboard_Controller1{


Public Transient List<Invite_Tracking__c> invitetracking;
String Projectdropdown = 'No Project Selected';
String selectedproject;
String Regiondropdown = 'No Region Selected';
String selectedRegion;
String selectedoperatinggroup;
String operatinggroup = 'No Operating Group Selected';
List<Invite_Tracking__c> projectlist;

    Public List<SelectOption> getItems(){ 
        projectlist = [Select Id, Project__c FROM Invite_Tracking__c ];
        List<SelectOption> options = new List<SelectOption>();
      
        options.add(new SelectOption('0', '-None-'));
        options.add(new SelectOption('COO Circle','COO Circle'));
        options.add(new SelectOption('CFO Circle','CFO Circle'));
        options.add(new SelectOption('CMO Circle','CMO Circle'));
        options.add(new SelectOption('CSO Circle','CSO Circle'));

        return options; 
    }
    
    Public String getSelectedProject() { 
        return selectedproject;    
    }   

    Public void setSelectedProject(String selectedproject) { 
        this.selectedproject = selectedproject;     
    }  
     
    Public List<SelectOption> getItems1(){
    
        List<SelectOption> options = new List<SelectOption>();
        
        options.add(new SelectOption('0','-None-'));
        options.add(new SelectOption('C&HT','C&HT'));
        options.add(new SelectOption('Financial Services','Financial Services'));
        options.add(new SelectOption('Health & Public Service','Health & Public Service'));
        options.add(new SelectOption('Other','Other'));
        options.add(new SelectOption('Products','Products'));
        options.add(new SelectOption('Resources','Resources'));
        options.add(new SelectOption('Unknown','Unknown'));    
        return options;
    }
  
    Public String getSelectedoperatinggroup(){
        return selectedoperatinggroup;
    }
  
    Public void setSelectedoperatinggroup(String selectedoperatinggroup){
        this.selectedoperatinggroup= selectedoperatinggroup;
    }
  
    Public List<SelectOption> getItems2(){
    
        List<SelectOption> options = new List<SelectOption>();
        
        options.add(new SelectOption('0','-None-'));
        options.add(new SelectOption('APAC','APAC'));
        options.add(new SelectOption('N America','N America'));
        options.add(new SelectOption('EALA','EALA'));

        return options;
    }
  
    Public String getSelectedregion(){
        return selectedregion;
    }
  
    Public void setSelectedregion(String selectedregion){
        this.selectedregion = selectedregion;
    }   
  
    Public String getOperatingGroup(){
        if(getSelectedoperatinggroup() <> '0'){    
            OperatingGroup = '';//' - ' + getSelectedProdFam();
        }
        else{
            OperatingGroup = ' - No Operating Group Selected';
        }
        
        return OperatingGroup;
    } 
  
    Public List<Invite_Tracking__c> getContacts(){
        if(getSelectedProject() <> '0' && getSelectedoperatinggroup() == '0' && getSelectedregion() == '0'){ 
            invitetracking = [SELECT Id,Project__c,Member__c,Contact__r.Exclude_from_Engagement_Index__c,
                              Contact__r.Member_Invite_Ranking__c,Contact__r.Region__c,Contact__r.FY_Quarter_Acceptance__c,
                              Counter__c, Organization__r.Operating_Group__c, Organization__r.Client_Classification__c,
                              Organization__r.Id, Organization__r.Global_FT_500_Position__c, Organization__r.Revenues_Mil_Value__c,
                              OrganizationId__c FROM Invite_Tracking__c WHERE Project__c = :getSelectedProject() AND 
                              Contact__r.Exclude_from_Engagement_Index__c = FALSE];
            system.debug('invitetracking: '+invitetracking);
        }    
        else
        if(getSelectedProject() <> '0' && getSelectedoperatinggroup() <> '0' && getSelectedregion() == '0'){
            invitetracking = [SELECT Id,Project__c,Member__c,Contact__r.Exclude_from_Engagement_Index__c,
                              Contact__r.Member_Invite_Ranking__c,Contact__r.Region__c,Contact__r.FY_Quarter_Acceptance__c,
                              Counter__c, Organization__r.Operating_Group__c, Organization__r.Client_Classification__c,
                              Organization__r.Id, Organization__r.Global_FT_500_Position__c, Organization__r.Revenues_Mil_Value__c,
                              OrganizationId__c FROM Invite_Tracking__c WHERE Project__c = :getSelectedProject() AND 
                              Contact__r.Exclude_from_Engagement_Index__c = FALSE AND Organization__r.Operating_Group__c = :getSelectedoperatinggroup()];
            system.debug('invitetracking: '+invitetracking);
        }
        else
        if(getSelectedProject() <> '0' && getSelectedoperatinggroup() <> '0' && getSelectedregion() <> '0'){    
            invitetracking = [SELECT Id,Project__c,Member__c,Contact__r.Exclude_from_Engagement_Index__c,
                              Contact__r.Member_Invite_Ranking__c,Contact__r.Region__c,Contact__r.FY_Quarter_Acceptance__c,
                              Counter__c, Organization__r.Operating_Group__c, Organization__r.Client_Classification__c,
                              Organization__r.Id, Organization__r.Global_FT_500_Position__c, Organization__r.Revenues_Mil_Value__c,
                              OrganizationId__c FROM Invite_Tracking__c WHERE Project__c = :getSelectedProject() AND 
                              Contact__r.Exclude_from_Engagement_Index__c = FALSE AND Contact__r.Region__c = :getSelectedregion() ORDER BY Engagement_Index_Sort__c ASC, Total__c DESC];
            system.debug('invitetracking: '+invitetracking);
        }    
        else
        if(getSelectedProject() <> '0' && getSelectedoperatinggroup() == '0' && getSelectedregion() <> '0'){    
            invitetracking = [SELECT Id,Project__c,Member__c,Contact__r.Exclude_from_Engagement_Index__c,
                              Contact__r.Member_Invite_Ranking__c,Contact__r.Region__c,Contact__r.FY_Quarter_Acceptance__c,
                              Counter__c, Organization__r.Operating_Group__c, Organization__r.Client_Classification__c,
                              Organization__r.Id, Organization__r.Global_FT_500_Position__c, Organization__r.Revenues_Mil_Value__c,
                              OrganizationId__c FROM Invite_Tracking__c WHERE project__c= :getSelectedProject() AND Contact__r.Region__c = :getSelectedregion() AND Contact__r.Exclude_from_Engagement_Index__c = FALSE ORDER BY Engagement_Index_Sort__c ASC, Total__c DESC];
            system.debug('invitetracking: '+invitetracking);
        }    
        else
        {
        Projectdropdown = 'No Project Selected';
        }
        
        return invitetracking;
    }
    
    Public PageReference printrecdash(){ 
        //return page.Recruitment_Dashboard_Excel;
        return null;
    }  

    Public PageReference save(){
        return null;
    }
    
    Public PageReference test(){
        getContacts();
        return null;
    }


 
//Accenture COO List **********************************************************************************************************//    
//Global Counts****************************************************************************************************************//    
    Public Integer getAcceptedMemberCount(){
    getContacts();
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Member__c == 'Community Member' && it.Contact__r.Member_Invite_Ranking__c == '1')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    } 
    
    Public Integer getPendingAccentureTeamCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if((it.Member__c == 'Pending - Accenture Team - invite extended' || it.Member__c == 'Pending - Accenture Team - contacted assistant' || it.Member__c == 'Pending - Accenture Team - currently unable to reach') && (it.Contact__r.Member_Invite_Ranking__c == '2.1' || it.Contact__r.Member_Invite_Ranking__c == '2.2' || it.Contact__r.Member_Invite_Ranking__c == '2.3'))
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getPendingCentralizedProcessCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if((it.Member__c == 'Pending - Centralized Process - invite extended' || it.Member__c == 'Pending - Centralized Process - contacted assistant' || it.Member__c == 'Pending - Centralized Process - currently unable to reach') && (it.Contact__r.Member_Invite_Ranking__c == '3.1' || it.Contact__r.Member_Invite_Ranking__c == '3.2' || it.Contact__r.Member_Invite_Ranking__c == '3.3'))
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getPendingInvitePOCTBDCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Member__c == 'Pending – Invite POC TBD' && it.Contact__r.Member_Invite_Ranking__c == '4')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getDeclinedCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Member__c == 'Declined' && it.Contact__r.Member_Invite_Ranking__c == '5')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getOnholdCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Member__c == 'On hold' && it.Contact__r.Member_Invite_Ranking__c == '6')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getApprovalRequiredNewExistingCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if((it.Member__c == 'Approval Required - Existing Target' || it.Member__c == 'Approval Required - New Target') && (it.Contact__r.Member_Invite_Ranking__c == '8.1' || it.Contact__r.Member_Invite_Ranking__c == '8.2'))
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getArbitratingCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if((it.Member__c == 'Arbitrating - Account' || it.Member__c == 'Arbitrating - Target') && (it.Contact__r.Member_Invite_Ranking__c == '7.1' || it.Contact__r.Member_Invite_Ranking__c == '7.2'))
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getFormerCommunityMemberCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if((it.Member__c == 'COO Circle Alumni' || it.Member__c == 'Former Community Member') && (it.Contact__r.Member_Invite_Ranking__c == '10' || it.Contact__r.Member_Invite_Ranking__c == '11'))
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getNolongerpursuingCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Member__c == 'No longer pursuing' && it.Contact__r.Member_Invite_Ranking__c == '12')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    
    Public Integer getCurrentlyInvestigatingCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Member__c == 'Currently Investigating' && it.Contact__r.Member_Invite_Ranking__c == '9')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }

//NA Counts *******************************************************************************************************************//
    
    Public Integer getNA_AcceptedMemberCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Member__c == 'Community Member' && it.Contact__r.Member_Invite_Ranking__c == '1' && it.Contact__r.Region__c == 'N America')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }
    

}

 

public class Recruitement_Dashboard_Controller2{

Public Transient List<Invite_Tracking__c> invitetracking;
    
    public Recruitement_Dashboard_Controller2(Recruitement_Dashboard_Controller1 custController) {
        invitetracking = custController.invitetracking;
        system.debug('invitetracking: '+invitetracking);
    }

//Recruits by by Operating Group **********************************************************************************************//    
//Recruiting ******************************************************************************************************************//    
    
    Public Integer getROGR_CHTCount(List<Invite_Tracking__c> invitetracking){
    system.debug('invitetracking: '+invitetracking);
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Organization__r.Operating_Group__c == 'C&HT' && it.Contact__r.Member_Invite_Ranking__c != '1')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }

    Public Integer getROGR_FSCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Organization__r.Operating_Group__c == 'Financial Services' && it.Contact__r.Member_Invite_Ranking__c != '1')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }

    Public Integer getROGR_PRODCount(){
        Integer counter = 0;
        
        for(Invite_Tracking__c it : invitetracking){
            if(it.Organization__r.Operating_Group__c == 'Products' && it.Contact__r.Member_Invite_Ranking__c != '1')
            counter += it.Counter__c.intValue();
        }
        system.debug('counter: '+counter);
        return counter;
    }


}

 

 

<apex:page controller="Recruitement_Dashboard_Controller1" extensions="Recruitement_Dashboard_Controller2" showheader="true" sidebar="false" tabStyle="Recruitment_Dashboard__tab" >

 

I get the following error: 

 

System.NullPointerException: Attempt to de-reference a null object 

Class.Recruitement_Dashboard_Controller2.getROGR_CHTCount: line 159, column 37 External entry point

 

How do i get this working?

 

Thanks,

 

Rudi

Hi All,

 

We developed a visualforce page to display contact records, the visualforce page contains colors based on rankings. The controller return a list of contacts, this list is transient, and the number of contacts returned equals 737 records, but we hit the view state limit error.

 

Please see the controller and VF page code attached. The code is reduced, i left the parts that indicates the intense colour if statements. The VF page displays alot of fields, so could not inclued the full code posting.

 

Any help please???

public class dataTableContacts {

//Public String selectedproject;
//Public List <Invite_Tracking__c> projectlist;
//Public String Projectdropdown = 'No Project Selected';
Public transient List <Invite_Tracking__c> c;



/* public List<SelectOption> getItems() { 
     projectlist = [Select Id, Project__c FROM Invite_Tracking__c ];
      List<SelectOption> options = new List<SelectOption>();      
         options.add(new SelectOption ('0', '-None-'));
   
     for(Invite_tracking__c sa : projectlist){ 
        options.add(new SelectOption(sa.Project__c,sa.Project__c));
    }
       return options; 
    }
    
     
   public String getSelectedProject() { 
    return selectedproject;
       }   
      
   public void setSelectedProject(String selectedproject) { 
    this.selectedproject = selectedproject;
    }  
  
    
 public List<SelectOption> getItems1() {
    
    List<SelectOption> options = new List<SelectOption>();
    
    options.add(new SelectOption('0','-None-'));
   // options.add(new SelectOption('AFEN','AFEN'));
    options.add(new SelectOption(''COO Circle'',''COO Circle''));
    options.add(new SelectOption('CFO Circle','CFO Circle'));
    options.add(new SelectOption('CMO Circle','CMO Circle'));
    options.add(new SelectOption('CSO Circle','CSO Circle'));
  //  options.add(new SelectOption('CTO Circle','CTO Circle'));
    
    return options;
}
*/
public List <Invite_tracking__c> getContacts() {
      c = null;
          c = [Select Organization__r.Name, Organization__r.Industry,  
               Organization__r.Operating_Group__c, Organization__r.Global_FT_500_Position__c, 
               Organization__r.Revenues_Mil_Value__c, Organization__r.US_Fortune_500_2009__c, Organization__r.NumberofEmployees,
               Organization__r.Client_Classification__c ,Contact__r.h_All_Feedback_Comments__c, 
               Contact__r.CAL_Approved_Name__c, Contact__r.CAL_Cell_Number__c, Contact__r.Name, Contact__r.CAL_Office_Number__c, 
               Contact__r.Client_Account_Lead__c, Contact__r.Date_Declined__c, Contact__r.Date_Identified_As_Target__c, 
               Contact__r.Date_Invite_Materials_Sent_to_PIE_CAL__c, Contact__r.Date_joined__c, 
               Contact__r.Date_of_CAL_Approval__c, Contact__r.Date_of_Exit__c, Contact__r.Dinner_Region__c, 
               Contact__r.EA_Email__c, Contact__r.Email, Contact__r.Executive_Assistant__c, Contact__r.Full_Name__c, 
               Contact__r.MailingStreet, Contact__r.MailingCity, Contact__r.MailingCountry, Contact__r.MailingState, Contact__r.Phone, Contact__r.MobilePhone, Contact__r.MailingPostalCode,
               Contact__r.Management_Link__c, Contact__r.Marketing_OG_Lead__c, Contact__r.Member__c, 
               Contact__r.PIE_Contact_CAL__c, Contact__r.Point_of_Contact__c, Contact__r.EA_Phone__c,
               Contact__r.Reason_for_Decline__c, Contact__r.Region__c,Contact__r.Title_Full__c, Contact__r.Direct_Line__c, Contact__r.Weblink_to_Bio__c, Contact__r.Member_Source__c, 
               Initial_Interview_Status__c, Interview_Time_Date__c, Interview_Conducted_by__c, Pre_PIE_Call_Name__c, 
               Pre_PIE_Status__c,Group_Call_Name__c, Group_Call_Status__c, Group_Call_Was_CAL_informed__c, 
               Small_Group_Call_Name__c, Small_Group_Call_Date__c, Small_Group_Call_Status__c, 
               Small_Group_call_Was_CAL_informed__c, Regional_Dinner_Date__c, Regional_Dinner_Status__c, 
               Summits_Date__c, Summits_Status__c, Regional_Roundtable_Date__c, Regional_Roundtable_Status__c, New_Member_Interview_Points__c, New_Member_Interview_Points_Possible__c, 
               Contact__r.Lead_Source__c, Member__c, Contact__r.Member_Invite_Ranking__c, Contact__r.Marketing_Contacts__c, New_Member_Interview__c, 
               Project__c, NMI_CAL_Initial_Interview_Status__c, Organization__r.Policy_1221_Company__c, 
               Organization__r.Competitor_Issue__c FROM Invite_Tracking__c  WHERE Project__c = 'COO Circle' order by Contact__r.Member_Invite_Ranking__c asc, Organization__r.name asc, Contact__r.name asc limit 750];
              return c;
              
         //  for( Invite_tracking__c it : c ) 
  }
 
  
       
    
}

 

<apex:page id="Page" showheader="true" sidebar="false" controller="dataTableContacts" standardstylesheets="false"  > 

<style>
.style16 {
    font-size: 10px;
    text-align: center;
    border-color: #000000;
    }
</style>

<apex:sectionHeader title="COO Invitation Tracking"/>
<apex:form >
   <apex:pageBlock >
     
      <apex:commandButton value="Print to Excel" action="{!save}"/>
   <br></br>
   <br></br>
     <apex:outputpanel id="out" layout="block" >
            
       
                            <apex:dataTable columnsWidth="1%,2%,2%,1.5%,20.5%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,1.5%,2%,1.5%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,2%,1.5%,1.5%,2%,1.5%,2%,1.5%,2%" value="{!Contacts}" var="c" border="1" style=" background-color: #C0C0C0; font-family: 'Arial';font-size:9px;  cellspacing:0 ;cellpadding:0; align:left"  >
                              <apex:column style="{!if(c.member__c='Community Member','background-color:#00FF00;text-align:centre; width:1%;',
                                                    if(c.member__c='Pending - Account Team - invite extended' || c.member__c='Pending - Account Team - contacted assistant' || c.member__c='Pending - Account Team - currently unable to reach','background-color:#FFFF00;text-align:centre;width:1%',
                                                    if(c.member__c='Pending - Centralized Process - contacted assistant' || c.member__c='Pending - Centralized Process - currently unable to reach' || c.member__c='Pending - Centralized Process - invite extended', 'background-color:#FFFF66;text-align:centre;width:1%',
                                                    if(c.member__c='Pending – Invite POC TBD', 'background-color:#FFFF99;text-align:centre;width:1%',
                                                    if(c.member__c='Declined', 'background-color:#FF0000;text-align:centre;width:1%',
                                                    if(c.member__c='Accenture opt-outs (legitimate)' || c.member__c='On hold','background-color:#FF9900;text-align:centre;width:1%',
                                                    if(c.member__c='Arbitrating - Account' || c.member__c='Arbitrating - Target','background-color:#FFCC99;text-align:centre;width:1%',
                                                    if(c.member__c='Approval Required - Existing Target' || c.member__c='Approval Required - New Target','background-color:#9E5ECE;text-align:centre;width:1%',
                                                    if(c.member__c='Currently Investigating','background-color:#FF99CC;text-align:centre;width:1%',
                                                    if(c.member__c='COO Circle Alumni','background-color:#99FF66;text-align:centre;width:1%',
                                                    if(c.member__c='Former Community Member','background-color:#B6DDE8;text-align:centre;width:1%',
                                                    if(c.member__c='No longer pursuing','background-color:#D8D8D8;text-align:centre;width:1%',
                                                    'background-color:grey'))))))))))))}">
                                    <apex:facet name="header">Rank</apex:facet>
                                    <apex:outputField value="{!c.Contact__r.Member_Invite_Ranking__c  }" style="font-weight:light; font-size:9px" />
                                </apex:column>
                                <apex:column style="{!if(c.member__c='Community Member','background-color:#00FF00;text-align:centre; width:1%;',
                                                    if(c.member__c='Pending - Account Team - invite extended' || c.member__c='Pending - Account Team - contacted assistant' || c.member__c='Pending - Account Team - currently unable to reach','background-color:#FFFF00;text-align:centre;width:1%',
                                                    if(c.member__c='Pending - Centralized Process - contacted assistant' || c.member__c='Pending - Centralized Process - currently unable to reach' || c.member__c='Pending - Centralized Process - invite extended', 'background-color:#FFFF66;text-align:centre;width:1%',
                                                    if(c.member__c='Pending – Invite POC TBD', 'background-color:#FFFF99;text-align:centre;width:1%',
                                                    if(c.member__c='Declined', 'background-color:#FF0000;text-align:centre;width:1%',
                                                    if(c.member__c='Accenture opt-outs (legitimate)' || c.member__c='On hold','background-color:#FF9900;text-align:centre;width:1%',
                                                    if(c.member__c='Arbitrating - Account' || c.member__c='Arbitrating - Target','background-color:#FFCC99;text-align:centre;width:1%',
                                                    if(c.member__c='Approval Required - Existing Target' || c.member__c='Approval Required - New Target','background-color:#9E5ECE;text-align:centre;width:1%',
                                                    if(c.member__c='Currently Investigating','background-color:#FF99CC;text-align:centre;width:1%',
                                                    if(c.member__c='COO Circle Alumni','background-color:#99FF66;text-align:centre;width:1%',
                                                    if(c.member__c='Former Community Member','background-color:#B6DDE8;text-align:centre;width:1%',
                                                    if(c.member__c='No longer pursuing','background-color:#D8D8D8;text-align:centre;width:1%',
                                                    'background-color:grey'))))))))))))}">
                                    <apex:facet name="header">Member Status?</apex:facet>
                                    <apex:outputField value="{!c.Contact__r.Member__c}" style="font-weight:light; font-size:9px" />
                                    </apex:column>
                                <apex:column style="{!if(c.member__c='Community Member','background-color:#00FF00;text-align:centre; width:1%;',
                                                    if(c.member__c='Pending - Account Team - invite extended' || c.member__c='Pending - Account Team - contacted assistant' || c.member__c='Pending - Account Team - currently unable to reach','background-color:#FFFF00;text-align:centre;width:1%',
                                                    if(c.member__c='Pending - Centralized Process - contacted assistant' || c.member__c='Pending - Centralized Process - currently unable to reach' || c.member__c='Pending - Centralized Process - invite extended', 'background-color:#FFFF66;text-align:centre;width:1%',
                                                    if(c.member__c='Pending – Invite POC TBD', 'background-color:#FFFF99;text-align:centre;width:1%',
                                                    if(c.member__c='Declined', 'background-color:#FF0000;text-align:centre;width:1%',
                                                    if(c.member__c='Accenture opt-outs (legitimate)' || c.member__c='On hold','background-color:#FF9900;text-align:centre;width:1%',
                                                    if(c.member__c='Arbitrating - Account' || c.member__c='Arbitrating - Target','background-color:#FFCC99;text-align:centre;width:1%',
                                                    if(c.member__c='Approval Required - Existing Target' || c.member__c='Approval Required - New Target','background-color:#9E5ECE;text-align:centre;width:1%',
                                                    if(c.member__c='Currently Investigating','background-color:#FF99CC;text-align:centre;width:1%',
                                                    if(c.member__c='COO Circle Alumni','background-color:#99FF66;text-align:centre;width:1%',
                                                    if(c.member__c='Former Community Member','background-color:#B6DDE8;text-align:centre;width:1%',
                                                    if(c.member__c='No longer pursuing','background-color:#D8D8D8;text-align:centre;width:1%',
                                                    'background-color:grey'))))))))))))}">
                                    <apex:facet name="header">Member Source</apex:facet>
                                    <apex:outputField value="{!c.Contact__r.Member_Source__c}" style="font-weight:light; font-size:9px" />
                                </apex:column>
                            </apex:dataTable>
               
                  </apex:outputpanel> 
             </apex:pageblockSection>
        </apex:pageBlock>
</apex:form>
</apex:page>

 

 

Thanks

 

Rudi

Hi All,

 

We need to add a manual AccountSharing records for Territories. We need to manage this process manually and cannot use the standard Territory functionality. In my trigger i have the following steps:

 

 

  • Get the account id
  • Get the territory id
  • Get the group id for the territory
  • Build a list of AccountSharing records to be inserted
The trigger saves correctly, but when i try to insert an account i get the following error:
REQUIRED_FIELD_MISSING, missing required field: AccountAccessLevel (Access level should not be specified on territory manual assignment): [AccountAccessLevel]:
Here is the final insert list code example:
for(ID tid : territoryids){
insert_account_territories.add(New AccountShare(
AccountId = accid,
UserOrGroupId = tid,
AccountAccessLevel = 'Read'));
}

 

Please help!!!!
Thanks,
Rudi

 

Hi All,
 
I have a class that i had to change to global due to the total characters limit. Now i want to reference the methods in this global class in another global class. I have searched the discussion boards but i keep getting: Method does not exist or incorrect signature
 
Please see the 2 classes below. How do i reference a method from the one global class in the other class? 
 

global class Recruitement_Dashboard_Controller{ private List<table> invitetracking; public Recruitement_Dashboard_Controller(ApexPages.StandardController controller) { invitetracking = [SELECT Id FROM table];system.debug('invitetracking: '+invitetracking); } //Global Counts****************************************************************************************************************// Public Integer getAcceptedMemberCount(){ Integer counter = 0; for(Invite_Tracking__c it : invitetracking){ if(field == 'text' && field == '1') counter += field.intValue();} system.debug('counter: '+counter); return counter; }

 

global class Recruitement_Dashboard_Controller2{ Public Integer test(){ Recruitement_Dashboard_Controller.getAcceptedMemberCount(); } }

 

 

Please help!!
 
Thanks,
 
Rudi 

Hi All,

 

I have managed to create a wrapper class containing a list of Contacts. I now need to add data from another object to each Contact to display in a large data table in a visual force page. How would i go about doing this? All the examples in the community cover how to add a check box next to each contact, but this not what i want to do.

 

I have attached my controller code and vf page. The second SELECT statement is the object info that i need returned. 

 

 

Please help! 

 

Thanks,

 

Rudi 

<apex:page id="Page" controller="dataTableContacts" sidebar="false" showHeader="true" tabStyle="Contact" contenttype="application/vnd.ms-excel#Invitation.xls" cache="true" ><apex:form > <apex:pageBlock title="Invitation Tracking" > <apex:dataTable value="{!Contacts}" var="c" border="2" width="75%" title="Invitation Tracking"> <apex:column width="5%"> <apex:facet name="header">Project</apex:facet> <apex:outputPanel layout="block" style="width:100%;overflow:hidden"> <apex:outputText value="{!c.contactlist.Project__c}"/> </apex:outputPanel> </apex:column> <apex:column > <apex:facet name="header">Name</apex:facet> <apex:outputPanel layout="block" style="width:100%;overflow:hidden"> <apex:outputText value="{!c.contactlist.Name}"/> </apex:outputPanel> </apex:column> <apex:column > <apex:facet name="header">Member Source</apex:facet> <apex:outputText value="{!c.contactlist.Member_Source__c}"/> </apex:column> <apex:column > <apex:facet name="header">Member</apex:facet> <apex:outputText value="{!c.contactlist.Member__c}"/> </apex:column> <apex:column > <apex:facet name="header">Date of CAL Approval</apex:facet> <apex:outputText value="{!c.contactlist.Date_of_CAL_Approval__c}"/> </apex:column> <apex:column > <apex:facet name="header">Date Invite Materials Sent to PIE/CAL</apex:facet> <apex:outputText value="{!c.contactlist.Date_Invite_Materials_Sent_to_PIE_CAL__c}"/> </apex:column> <apex:column > <apex:facet name="header">Organisation Name</apex:facet> <apex:outputText value="{!c.contactlist.Account.Name}"/> </apex:column> <apex:column > <apex:facet name="header">Full Name</apex:facet> <apex:outputText value="{!c.contactlist.Name}"/> </apex:column> <apex:column > <apex:facet name="header">Title (Abbreviation)</apex:facet> <apex:outputText value="{!c.contactlist.Title_Full__c}"/> </apex:column> <apex:column > <apex:facet name="header">Operating Group</apex:facet> <apex:outputText value="{!c.contactlist.Account.Operating_Group__c}"/> </apex:column> <apex:column > <apex:facet name="header">Industry</apex:facet> <apex:outputText value="{!c.contactlist.Account.Industry}"/> </apex:column> <apex:column > <apex:facet name="header">Client Classification</apex:facet> <apex:outputText value="{!c.contactlist.Account.Client_Classification__c}"/> </apex:column> <apex:column > <apex:facet name="header">Client Account Lead</apex:facet> <apex:outputText value="{!c.contactlist.Client_Account_Lead__c}"/> </apex:column> <apex:column > <apex:facet name="header">Marketing Contacts</apex:facet> <apex:outputText value="{!c.contactlist.Marketing_OG_Lead__c}"/> </apex:column> <apex:column > <apex:facet name="header">Region</apex:facet> <apex:outputText value="{!c.contactlist.Region__c}"/> </apex:column> <apex:column > <apex:facet name="header">Point of Contact (POC)</apex:facet> <apex:outputText value="{!c.contactlist.Point_of_Contact__c}"/> </apex:column> <apex:column > <apex:facet name="header">Management Link</apex:facet> <apex:outputText value="{!c.contactlist.Management_Link__c}"/> </apex:column> <apex:column > <apex:facet name="header">Revenues (Mil) Value</apex:facet> <apex:outputText value="{!c.contactlist.Account.Revenues_Mil_Value__c}"/> </apex:column> <apex:column > <apex:facet name="header">Comments</apex:facet> <apex: value="{!c.contactlist.h_All_Feedback_Comments__c}"/> </apex:column> </apex:dataTable> </apex:pageBlock></apex:form></apex:page>

public class dataTableContacts {private final String project;public Transient List<cContact> contactlist {get; set;} public dataTableContacts() { project = ApexPages.currentPage().getParameters().get('String'); System.debug('project: '+project); } public List<cContact> getContacts() { if (contactlist == null){ contactlist = new List<cContact>(); for (Contact c : [SELECT Id, Name, Region__c, Member__c, Member_Source__c, Client_Account_Lead__c, Title_Full__c, Project__c, Management_Link__c, Marketing_OG_Lead__c, Marketing_Contacts__c, Point_of_Contact__c, Date_of_CAL_Approval__c, Date_Invite_Materials_Sent_to_PIE_CAL__c, Account.Name, Account.Industry, Account.Operating_Group__c, Account.Revenues_Mil_Value__c, Account.Client_Classification__c , h_All_Feedback_Comments__c, (SELECT Id, Name, Organisation__c, Title__c, Date_of_Interview__c, Project__c, Comments__c, Points_Received__c, Points_Possible__c, Percent__c, Interview_Status__c, Interview_Conducted_By__c FROM New_Member_Interview__r) FROM Contact WHERE Project__c = :project limit 1000]){ contactlist.add(new cContact(c)); System.debug('contactlist: '+contactlist); } } return contactlist; } public class cContact{ public Contact contactlist {get; set;} public cContact(Contact c){ contactlist = c; } }}

 

 

 

Hi All,

 

We need to display data related to Contacts from multiple custom objects combined into one row. We used to use a matrix type excel spreadsheet to display some nice graphs and colored indicators. We have now created custom objects (between 5 and 10, might add more later) related to Contacts, all linked by a master detail relationship.

 

e.g.

Contacts Object           Feedback Object      Surveys Object

Name1, Phone, Email      Date, Comments        Survey Name, Type, Date

Name2, Phone, Email      Date, Comments        Survey Name, Type, Date 

Name3, Phone, Email      Date, Comments        Survey Name, Type, Date 

 

and so on.....

 

What would be the best way to go about accomplishing this type of visualforce page?

 

I am going through the discussion boards reading up a lot, but though i would get some expert advice :)

 

Thanks,

 

Rudi 

Hi there all,

 

I am trying to create a table with the columns on the left hand side, and display the returned data on the right hand side??:

 

Column 1          Product.Name

Column 2          Product.Description

Column 3          Product.Quantity

Column 4          Product.Price

 

Then, just to make it interesting, i need to repeat the table for each product in the returned list??

 

Please any suggestions would be greatly appreciated!!

 

Thanks,

 

Rudi 

Hi All,

 

I am trying to replicate the following HTML table in a visualforce page. The data is from one object that is linked to the opportunity object. I need to be able to indicate the totals between each section of the table. The table contains 3 detail sections and 4 total sections. I have been reading up in the community but am stuck, any ideas would be greatly appreciated.

 

 

 

 

 

Facility

(all figures in rand)

 

Current

facilities

Facilities

sought

Date: d/m/yy

Utilisation

 

Equity

a

 

 

 

 

Term lending

b

 

 

 

 

GSTBF

c

 

 

 

 

Bond positions / Credit derivatives

 

 

 

 

 

Vehicle & Asset Finance

 

 

 

 

 

Letters of credit

 

 

 

 

 

Lending guarantees

 

 

 

 

 

Total direct facilities

 

0

0

0

 

Performance guarantees

 

 

 

 

 

FX and FX options

 

 

 

 

 

Derivatives

 

 

 

 

 

Total indirect facilities

 

0

0

0

 

Total SBSA

 

0

0

0

 

Electronic banking facilities

 

 

 

 

 

Other bank borrowings

 

 

 

 

 

Other lenders

 

 

 

 

 

Total arranged borrowings

 

0

0

0

 

 

 

Thanks,

 

Rudi 

Hi All,

 

We have 3 HTML templates used by Print Anything to print out quotes. We have a long text field on the Accounts object containing the terms and conditions for each account, this is specific to each account. The formatting and spacing is correct in the UI but when this field is added to the Print Anything template, all the formatting and spaces are removed and only large continues text is displayed. Has anybody found a way to display the long text field with all the formatting and spacing intact?

 

Also when printing the Print Anything template the header displayes "Printable View" and the page number, and the footer displayes the salesforce web address and date. Is there a way this can be removed?

 

I have attached examples of my questions. Any assistance on this will be greatly appreciated!

 

Thanks,

 

Rudster 

 

HI,

 

We have a visualforce page with 3 multi select picklists for the user to select from. We construct the search query in the controller and 'includes', but we get the following error on submission:

 

System.QueryException: expecting a left parentheses, found ':'

Class.searchContact.doSearch: line 175, column 21 External entry point

 

Here is the code for the controller:

 

public class searchContact {
   public String API { get; set; }
   public String apiSessionId {get;set;} 
   public String apiServerURL {get;set;}

  string selectedrating;
  string searchString;
  string recType = 'Candidate';
  string[] grades;
  string[] specialities;
  string[] locations;
  string gmcreg;
  string segment;
  boolean w4f;
  boolean hotdoc;
 
  List<Contact> results;
 
  private final Contact contact;
 
  public searchContact() {
     contact = [SELECT Id, LastName, FirstName, Salutation, Name, MobilePhone, LastModifiedDate, LastActivityDate, a__Rating__c, Doc_Rating__c,
                GMC_reg__c, Grade_s__c, Hot_doc__c, Locations__c, Nationality__c, Speciality__c, Worked_4_Fresh__c, Avail_W_E__c,
                Avail_F_T__c, Avail_from__c, Avail_Updated__c, Segment__c, Job_Ends__c, Current__c, Account.Type, RecordType.Name,
                RecordType.Description, Owner.Username, Owner.LastName, Owner.FirstName, LastModifiedBy.Username, LastModifiedBy.LastName,
                LastModifiedBy.FirstName FROM Contact where RecordType.Name='Candidate' limit 1];
  }
 
  public Contact getContact() {
    return contact;
  }
 
  public String[] getGrades() {
     if (contact.Grade_s__c == null || contact.Grade_s__c == '') {     
       //apexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, 'Please select one or more grade first.'));     
        grades = null;     
     }
     else
     {   
     grades = contact.Grade_s__c.split(';',0);   
     }
     return grades; 
  }
 
   public String[] getSpecialities() {
    
       if (contact.Speciality__c == null || contact.Speciality__c == '') {     
        specialities = null;     
     }
     else
     {     
     specialities = contact.Speciality__c.split(';',0);  
     }
     return specialities;
  }
 
    public String[] getLocations() {
    
       if (contact.Locations__c == null || contact.Locations__c == '') {     
        locations= null;     
     }
     else
     {     
     locations= contact.Locations__c.split(';',0);  
     }
     return locations;
  }
 
  public String getSegment() {
    
       if (contact.Segment__c == null || contact.Segment__c == '') {     
        segment= null;     
     }
     else
     {     
     segment= contact.Segment__c;  
     }
     return segment;
  }

  public String getGMCReg() {
    
       if (contact.GMC_reg__c == null || contact.GMC_reg__c == '') {     
        gmcreg= null;     
     }
     else
     {     
     gmcreg= contact.GMC_reg__c;  
     }
     return gmcreg;
  }
 
    public List<SelectOption> getItems() {
    List<SelectOption> options = new List<SelectOption>();
   
    options.add(new SelectOption('0','--None--'));
    options.add(new SelectOption('1','1'));
    options.add(new SelectOption('2','2'));
    options.add(new SelectOption('3','3'));
    options.add(new SelectOption('4','4'));
    //options.add(new SelectOption('5','5'));
   
    return options;
  }
 
  public String getSelectedRating() {
    return selectedrating;
  }
 
  public void setSelectedRating(String selectedrating) {
    this.selectedrating = selectedrating;
  }   
     
  public Boolean getW4F() {  
     w4f = contact.Worked_4_Fresh__c;  
     return w4f ;
  }
 
    public Boolean getHotDoc() {  
     hotdoc= contact.Hot_doc__c;  
     return hotdoc;
  }
 
  public List<Contact> getResults() {   
    return results;
  }
 
  public PageReference doSearch() {
     results=null;
    
    searchString = 'SELECT Grade_s__c, Speciality__c, Locations__c, Segment__c, GMC_reg__c, a__Rating__c, Worked_4_Fresh__c, Contact_Link__c, Id, Name, LastName, FirstName, MobilePhone, Doc_Rating__c, Current__c, Hot_doc__c, Avail_F_T__c, Avail_W_E__c, Avail_from__c, Job_Ends__c, Avail_Updated__c, LastModifiedBy.Username, LastModifiedDate, Owner.Username, LastActivityDate, Nationality__c FROM Contact where RecordType.Name=:recType';

     getGrades(); 
     getSpecialities();
     getLocations();
     getSegment();
     getGMCReg();
     getSelectedRating();
     getW4F();
     getHotDoc();
    
    
     if (grades != null && grades.size() > 0)    {            
             searchString += ' and Grade_s__c includes :grades';
     }
    
     if (specialities!= null && specialities.size() > 0)    {
       searchString += ' and Speciality__c includes :specialities';
     }
          
      if (locations!= null && locations.size() > 0)    {
       searchString += ' and Locations__c includes :locations';
     }
    
       if (segment!= null)    {
              searchString += ' and Segment__c = :segment';
     }
       if (gmcreg!= null)  {
              searchString += ' and GMC_reg__c = :gmcreg';
     }         
    
     if (selectedrating != null && selectedrating != '0')    {
              searchString += ' and Doc_Rating__c  = :selectedrating';
     }        
     
      if (w4f != false)    {
              searchString += ' and Worked_4_Fresh__c  = :w4f';
     }
      if (hotdoc != false)    {
              searchString += ' and Hot_doc__c  = :hotdoc';
     }
         
          apexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, searchString));
 
          results = Database.query(searchString);
          if (results.size() == 0) {
            apexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, 'Sorry, no results for current selected criteria')); 
          }
          else
          {
            apexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, 'Count : '+ results.size())); 
          }
     return null;      
  }
 
  public PageReference doSend() {
    return null;
  }    
 
 
}

 

Please Help!!

 

Thanks,

 

Rudster

 

Hi There,

 

We have a class and 2 triggers to deploy to production, everything works perfectly in the sandbox, but when we deploy toproduction we get the following errors:

 

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY - Maximum trigger depth exceeded on a non recursive trigger

 

We have 2 triggers on the Quotes object and it seems these triggers are causing the issue, but im not sure how to fix them, i have added the code for the triggers below.

 

If anybody could assist woth this it would be great!!

 

trigger UpdateAdjustedFieldsLineItems on SFDC_520_Quote__c (after update) {

  //Get Quote ID
  SFDC_520_Quote__c[] q1 = trigger.new;
  String strQID = q1[0].id;
  System.debug('E Quote Id : '+strQID);

  //Get QuoteLine ID's and Adjusted Fields
  SFDC_520_QuoteLine__c[] ql1 = [SELECT Adjusted_COST_PRICE__c,
                                Adjusted_SELLING_PRICE__c
                                FROM SFDC_520_QuoteLine__c WHERE Quote__r.Id = :strQID];
                               
  System.debug('E Size ql1 : '+ ql1.size());
 
  for (Integer i = 0; i < ql1.size(); i++) {                             
                               
   String strQLID = ql1[i].id;
   System.debug('E Quote Line Id : '+strQLID);

   Decimal strAdjCost = ql1[i].Adjusted_COST_PRICE__c;
   Decimal strAdjSell = ql1[i].Adjusted_SELLING_PRICE__c;
 
   System.debug('E ADJ COST : '+strAdjCost);
   System.debug('E ADJ SELLING : '+strAdjSell);
 
   //Update Adjusted Fields
   if((strAdjCost != 0.0) && (strAdjSell != 0.0)) {

     SFDC_520_QuoteLine__c[] q = [SELECT Adjusted_GP_Perc__c FROM SFDC_520_QuoteLine__c WHERE Id = :strQLID];
     Decimal strAdjGP = 1 - (strAdjCost / strAdjSell) * 100;
     System.debug('E Adjusted GP Perc : ' + strAdjGP);                           
     q[0].Adjusted_GP_Perc__c = strAdjGP; 

     update q;
    }
  }
}

Message Edited by RudiHulsbos on 05-28-2009 09:15 AM
Hi All,
 
I have a class that i had to change to global due to the total characters limit. Now i want to reference the methods in this global class in another global class. I have searched the discussion boards but i keep getting: Method does not exist or incorrect signature
 
Please see the 2 classes below. How do i reference a method from the one global class in the other class? 
 

global class Recruitement_Dashboard_Controller{ private List<table> invitetracking; public Recruitement_Dashboard_Controller(ApexPages.StandardController controller) { invitetracking = [SELECT Id FROM table];system.debug('invitetracking: '+invitetracking); } //Global Counts****************************************************************************************************************// Public Integer getAcceptedMemberCount(){ Integer counter = 0; for(Invite_Tracking__c it : invitetracking){ if(field == 'text' && field == '1') counter += field.intValue();} system.debug('counter: '+counter); return counter; }

 

global class Recruitement_Dashboard_Controller2{ Public Integer test(){ Recruitement_Dashboard_Controller.getAcceptedMemberCount(); } }

 

 

Please help!!
 
Thanks,
 
Rudi 

Hi All,

 

I have managed to create a wrapper class containing a list of Contacts. I now need to add data from another object to each Contact to display in a large data table in a visual force page. How would i go about doing this? All the examples in the community cover how to add a check box next to each contact, but this not what i want to do.

 

I have attached my controller code and vf page. The second SELECT statement is the object info that i need returned. 

 

 

Please help! 

 

Thanks,

 

Rudi 

<apex:page id="Page" controller="dataTableContacts" sidebar="false" showHeader="true" tabStyle="Contact" contenttype="application/vnd.ms-excel#Invitation.xls" cache="true" ><apex:form > <apex:pageBlock title="Invitation Tracking" > <apex:dataTable value="{!Contacts}" var="c" border="2" width="75%" title="Invitation Tracking"> <apex:column width="5%"> <apex:facet name="header">Project</apex:facet> <apex:outputPanel layout="block" style="width:100%;overflow:hidden"> <apex:outputText value="{!c.contactlist.Project__c}"/> </apex:outputPanel> </apex:column> <apex:column > <apex:facet name="header">Name</apex:facet> <apex:outputPanel layout="block" style="width:100%;overflow:hidden"> <apex:outputText value="{!c.contactlist.Name}"/> </apex:outputPanel> </apex:column> <apex:column > <apex:facet name="header">Member Source</apex:facet> <apex:outputText value="{!c.contactlist.Member_Source__c}"/> </apex:column> <apex:column > <apex:facet name="header">Member</apex:facet> <apex:outputText value="{!c.contactlist.Member__c}"/> </apex:column> <apex:column > <apex:facet name="header">Date of CAL Approval</apex:facet> <apex:outputText value="{!c.contactlist.Date_of_CAL_Approval__c}"/> </apex:column> <apex:column > <apex:facet name="header">Date Invite Materials Sent to PIE/CAL</apex:facet> <apex:outputText value="{!c.contactlist.Date_Invite_Materials_Sent_to_PIE_CAL__c}"/> </apex:column> <apex:column > <apex:facet name="header">Organisation Name</apex:facet> <apex:outputText value="{!c.contactlist.Account.Name}"/> </apex:column> <apex:column > <apex:facet name="header">Full Name</apex:facet> <apex:outputText value="{!c.contactlist.Name}"/> </apex:column> <apex:column > <apex:facet name="header">Title (Abbreviation)</apex:facet> <apex:outputText value="{!c.contactlist.Title_Full__c}"/> </apex:column> <apex:column > <apex:facet name="header">Operating Group</apex:facet> <apex:outputText value="{!c.contactlist.Account.Operating_Group__c}"/> </apex:column> <apex:column > <apex:facet name="header">Industry</apex:facet> <apex:outputText value="{!c.contactlist.Account.Industry}"/> </apex:column> <apex:column > <apex:facet name="header">Client Classification</apex:facet> <apex:outputText value="{!c.contactlist.Account.Client_Classification__c}"/> </apex:column> <apex:column > <apex:facet name="header">Client Account Lead</apex:facet> <apex:outputText value="{!c.contactlist.Client_Account_Lead__c}"/> </apex:column> <apex:column > <apex:facet name="header">Marketing Contacts</apex:facet> <apex:outputText value="{!c.contactlist.Marketing_OG_Lead__c}"/> </apex:column> <apex:column > <apex:facet name="header">Region</apex:facet> <apex:outputText value="{!c.contactlist.Region__c}"/> </apex:column> <apex:column > <apex:facet name="header">Point of Contact (POC)</apex:facet> <apex:outputText value="{!c.contactlist.Point_of_Contact__c}"/> </apex:column> <apex:column > <apex:facet name="header">Management Link</apex:facet> <apex:outputText value="{!c.contactlist.Management_Link__c}"/> </apex:column> <apex:column > <apex:facet name="header">Revenues (Mil) Value</apex:facet> <apex:outputText value="{!c.contactlist.Account.Revenues_Mil_Value__c}"/> </apex:column> <apex:column > <apex:facet name="header">Comments</apex:facet> <apex: value="{!c.contactlist.h_All_Feedback_Comments__c}"/> </apex:column> </apex:dataTable> </apex:pageBlock></apex:form></apex:page>

public class dataTableContacts {private final String project;public Transient List<cContact> contactlist {get; set;} public dataTableContacts() { project = ApexPages.currentPage().getParameters().get('String'); System.debug('project: '+project); } public List<cContact> getContacts() { if (contactlist == null){ contactlist = new List<cContact>(); for (Contact c : [SELECT Id, Name, Region__c, Member__c, Member_Source__c, Client_Account_Lead__c, Title_Full__c, Project__c, Management_Link__c, Marketing_OG_Lead__c, Marketing_Contacts__c, Point_of_Contact__c, Date_of_CAL_Approval__c, Date_Invite_Materials_Sent_to_PIE_CAL__c, Account.Name, Account.Industry, Account.Operating_Group__c, Account.Revenues_Mil_Value__c, Account.Client_Classification__c , h_All_Feedback_Comments__c, (SELECT Id, Name, Organisation__c, Title__c, Date_of_Interview__c, Project__c, Comments__c, Points_Received__c, Points_Possible__c, Percent__c, Interview_Status__c, Interview_Conducted_By__c FROM New_Member_Interview__r) FROM Contact WHERE Project__c = :project limit 1000]){ contactlist.add(new cContact(c)); System.debug('contactlist: '+contactlist); } } return contactlist; } public class cContact{ public Contact contactlist {get; set;} public cContact(Contact c){ contactlist = c; } }}

 

 

 

Hi there all,

 

I am trying to create a table with the columns on the left hand side, and display the returned data on the right hand side??:

 

Column 1          Product.Name

Column 2          Product.Description

Column 3          Product.Quantity

Column 4          Product.Price

 

Then, just to make it interesting, i need to repeat the table for each product in the returned list??

 

Please any suggestions would be greatly appreciated!!

 

Thanks,

 

Rudi 

Hi There,

 

We have a class and 2 triggers to deploy to production, everything works perfectly in the sandbox, but when we deploy toproduction we get the following errors:

 

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY - Maximum trigger depth exceeded on a non recursive trigger

 

We have 2 triggers on the Quotes object and it seems these triggers are causing the issue, but im not sure how to fix them, i have added the code for the triggers below.

 

If anybody could assist woth this it would be great!!

 

trigger UpdateAdjustedFieldsLineItems on SFDC_520_Quote__c (after update) {

  //Get Quote ID
  SFDC_520_Quote__c[] q1 = trigger.new;
  String strQID = q1[0].id;
  System.debug('E Quote Id : '+strQID);

  //Get QuoteLine ID's and Adjusted Fields
  SFDC_520_QuoteLine__c[] ql1 = [SELECT Adjusted_COST_PRICE__c,
                                Adjusted_SELLING_PRICE__c
                                FROM SFDC_520_QuoteLine__c WHERE Quote__r.Id = :strQID];
                               
  System.debug('E Size ql1 : '+ ql1.size());
 
  for (Integer i = 0; i < ql1.size(); i++) {                             
                               
   String strQLID = ql1[i].id;
   System.debug('E Quote Line Id : '+strQLID);

   Decimal strAdjCost = ql1[i].Adjusted_COST_PRICE__c;
   Decimal strAdjSell = ql1[i].Adjusted_SELLING_PRICE__c;
 
   System.debug('E ADJ COST : '+strAdjCost);
   System.debug('E ADJ SELLING : '+strAdjSell);
 
   //Update Adjusted Fields
   if((strAdjCost != 0.0) && (strAdjSell != 0.0)) {

     SFDC_520_QuoteLine__c[] q = [SELECT Adjusted_GP_Perc__c FROM SFDC_520_QuoteLine__c WHERE Id = :strQLID];
     Decimal strAdjGP = 1 - (strAdjCost / strAdjSell) * 100;
     System.debug('E Adjusted GP Perc : ' + strAdjGP);                           
     q[0].Adjusted_GP_Perc__c = strAdjGP; 

     update q;
    }
  }
}

Message Edited by RudiHulsbos on 05-28-2009 09:15 AM
Hi All,
 
I'm in the midst of using Print Anything.
The Tutorial of Print Invitation works fine when I log in as System Administrator.
But when I login as another user with non-system administrator profile, the below error message pops up
 

INVALID_TYPE: pkg.PRINTANY__Templates__r tmp) from PRINTANY__Package__c pkg where pkg.PRINTANY__Name__c ^ ERROR at Row:1:Column:166 sObject type 'PRINTANY__Package__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Any lead is much appreciated.

regards

Rob.

 


 
When implementing a print anything document everything looks fine in IE 6 or 7 but firefox outputs garbage character stream. Does anyone know why??
  • May 10, 2007
  • Like
  • 0