• neckr2
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi - I can't seem to figure out how to get my setter method to bind to my page.  The none of my setter methods are being called.

 

public with sharing class ConRegWizController {

 
Account account;
Shadow_Account__c shadowacct;
Contact primarycontact;

User user = [SELECT id, AccountId, ContactID FROM User WHERE id = : UserInfo.getUserId()];

 public ConRegWizController() {
            //Retrieve records for Portal Users
            if(user.AccountID != NULL ) {
            account = [SELECT id, Name FROM Account WHERE id = : user.AccountID];
            shadowacct = [SELECT id, Name, Con_Annual_Revenue__c, Con_In_Business_Since__c, City__c, Country__c, Postal_Zip_Code__c, Province_State__c, Street__c, Con_Legal_Business_Name__c, Con_Number_of_Employees__c, Con_Type_of_Business__c, Website__c, Con_Work_Category__c FROM Shadow_Account__c WHERE Account__c = : user.AccountID];
            primarycontact = [SELECT id, LastName, FirstName, Phone, MobilePhone, Email, Primary_Contact__c FROM Contact WHERE AccountID = :user.AccountID AND Primary_Contact__c = TRUE ];
            }
           

            
            //Retrieve records for Standard Users
            else        {
            account = [SELECT id, Name FROM Account WHERE id = :ApexPages.currentPage().getParameters().get('id')];
            shadowacct = [SELECT id, Name, Con_Annual_Revenue__c, Con_In_Business_Since__c, City__c, Country__c, Postal_Zip_Code__c, Province_State__c, Street__c, Con_Legal_Business_Name__c, Con_Number_of_Employees__c, Con_Type_of_Business__c, Website__c, Con_Work_Category__c FROM Shadow_Account__c WHERE Account__c = :ApexPages.currentPage().getParameters().get('id')];
            primarycontact = [SELECT id, LastName, FirstName, Phone, MobilePhone, Email, Primary_Contact__c FROM Contact WHERE AccountID = :ApexPages.currentPage().getParameters().get('id') AND Primary_Contact__c = TRUE ];
            }
            
                       
 }


  public Account getAccount() {
      if(account == null)  account = new Account();
      return account;
   }
   
  public void setAccount(Account ACCT)
    {
        Account = ACCT;
    }

 public Shadow_Account__c getShadowAcct() {
      system.debug('DEBUG: shadowacct =' + shadowacct);
      if(shadowacct == null) shadowacct = new Shadow_Account__c ();
      return shadowacct;
   }
   
     public void setShadowAcct(Shadow_Account__c SA)
    {
         system.debug('DEBUG: Entering Shadow Acct Setter method'); //Does not enter method
        ShadowAcct = SA;
    }

  public Contact getprimaryContact() {
       system.debug('DEBUG: primarycontact =' + primarycontact);
      if(primarycontact == null) primarycontact = new Contact();
      return primarycontact;
   }

  public void setprimaryContact(Contact CONT)
    {
        system.debug('DEBUG: Entering Primary Contact Setter method'); //Does not enter method
        primaryContact = CONT;
    }



public PageReference step1() {
      return Page.ContractorRegistrationStep1 ;
    
   }

   public PageReference step2() {
     return Page.ContractorRegistrationStep2;
    
   }

   public PageReference step3() {
      return Page.ContractorRegistrationStep3 ;
     
   }
   
   
   public PageReference step4() {
      return Page.ContractorRegistrationStep4 ;
     
   }
   
   public PageReference step5() {
      return Page.ContractorRegistrationStep5 ;
    
   }

Public pageReference Save() {
  
  system.debug('DEBUG: shadowacct =' + shadowacct.Con_Legal_Business_Name__c);
  system.debug('DEBUG: primarycontact =' + primarycontact.LastName);
   update shadowacct;
   update primarycontact;
   
   /*PageReference ContractorDetails = Page.ContractorDetails;
   ContractorDetails.getParameters().put('ID',acct.ID);
   ContractorDetails.setRedirect(true);   
   return ContractorDetails; */
   
   return Page.ContractorRegistrationStep5;
  
}
     

 

<apex:page sidebar="false" Controller="ConRegWizController">
    <apex:sectionHeader title="Contractor Registration" subtitle="1 of 5 Company & Contact Information"/>   
         <apex:form >
           <apex:pageBlock mode="Detail" >
 
           <apex:pageBlockButtons location="both">
                <apex:commandButton action="{!Save}" value="Save & Exit" styleClass="btn" onclick="return confirmExit()" immediate="true"/>
                 <apex:commandButton action="{!Cancel}" value="Cancel" styleClass="btn" onclick="return confirmCancel()" immediate="true"/>
                <apex:commandButton value="Next" action="{!Step2}" styleClass="btn" />
           </apex:pageBlockButtons> 
           
           <apex:pageBlockSection title="{!Account.Name} Information">
           <apex:inputField value="{!ShadowAcct.Name}"/>
           <apex:inputField value="{!ShadowAcct.Con_Work_Category__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Legal_Business_Name__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Type_of_Business__c}"/>
           <apex:inputField value="{!ShadowAcct.Street__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Number_of_Employees__c}"/>
           <apex:inputField value="{!ShadowAcct.City__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Annual_Revenue__c}"/>
           <apex:inputField value="{!ShadowAcct.Province_State__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_In_Business_Since__c}"/>
           <apex:inputField value="{!ShadowAcct.Postal_Zip_Code__c}"/>
           <apex:inputField value="{!ShadowAcct.Website__c}"/>
           <apex:inputField value="{!ShadowAcct.Country__c}"/>
         </apex:pageBlockSection>
         
           
           <apex:pageBlockSection title="Primary Contact Information" rendered="{!PrimaryContact.Primary_Contact__c}">
            <apex:inputField value="{!PrimaryContact.FirstName}"/>
            <apex:inputField value="{!PrimaryContact.Phone}"/>
            <apex:inputField value="{!PrimaryContact.LastName}"/>
            <apex:inputField value="{!PrimaryContact.MobilePhone}"/>
            <apex:inputField value="{!PrimaryContact.Email}"/>
           </apex:pageBlockSection>

                    
             
  
        </apex:pageBlock>
        
        </apex:form>

</apex:page>

 

  • October 25, 2011
  • Like
  • 0

we are a worldwide company 24x7 and have many processes which span timezones and location business hours.

we have a table in our old system of business hours by country..   no problem, I can do that in SF too..

 

so I defined the default (us eastern), used the bulk loaded to extract it (to get the data format)

modeled my 187 records after that model

 

but bulk load fails with a ' need a sundastarttime', value provided incorrect.. 08:00:00.00Z

which matches exactly the extract format. hh:mm:ss.ttZ... timezone def

 

anyone have the magic incantation to help me understand this?

I can type them in.. but why do that...

 

Sam

I created custom text fields to use as labels to get around the 40 character field constraint.  I want to display this associated fields as labels using field sets.  I created two field sets, one with the fields and one with the inputtext fields as labels.

 

My initial thought was two use to repeat functions but it loops around the 2nd field set too many times. Any thoughts on how I can achieve my objective?

 

 

 <apex:form >  
       <apex:pageBlock title="Without Field Set Use">  
       <apex:pageBlockSection title="Dynamic Object">  
           
          <apex:repeat value="{!$ObjectType.Field_Holder_1__c.FieldSets.ST00192_Labels}" var="fieldlabelAPIName">
        <apex:repeat value="{!$ObjectType.Field_Holder_1__c.FieldSets.ST00192}" var="fieldAPIName">
         
             <apex:pageblockSectionItem >
                 <apex:outputfield value="{!sObjectToBind[fieldlabelAPIName]}"/> 
                 <apex:inputField value="{!sObjectToBind[fieldAPIName]}"/>
             </apex:pageblockSectionItem>
           </apex:repeat>
                 </apex:repeat> 
       </apex:pageBlockSection>  
       </apex:pageBlock>  
   </apex:form>  

 

 

  • June 13, 2011
  • Like
  • 0