• Narayan H
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Pelco

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I want to auto-populate Account Name and Address fields from matching Account record on entering Account Number. On entering Account Number it should do a auto look-up and if found any matching record then the Account and Address fields to be populated. Here is my VF page. Appreciate your help

<apex:page standardController="RMA__c" >
    <apex:form >
        
         <apex:pageBlock >
           <apex:outputLink value="/{!RMA__c.Id}" >Go Back to Case: {!RMA__c.Case_Number__c}</apex:outputLink>     
         </apex:pageBlock>
           
         <apex:pageBlock title="Create RMA">
             
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>      
             
            <apex:pageBlockSection title="Caller Details" columns="1" collapsible="false">
                <apex:inputField required="true" value="{!RMA__c.First_Name__c}" label="First Name"/>
                <apex:inputField required="true" value="{!RMA__c.Last_Name__c}" label="Last Name"/>
                <apex:inputField required="true" value="{!RMA__c.Phone__c}" label="Phone #"/>
                <apex:inputField required="true" value="{!RMA__c.Email_Address__c}" label="Email Address"/>
                <apex:inputField value="{!RMA__c.Case__c}" label="Case Number"/>
                <apex:inputField value="{!RMA__c.PO_Number__c}" label="PO Number"/>
                <apex:inputField value="{!RMA__c.Account_Number__c}" label="Account Number"/> 
                
                <apex:inputCheckbox value="{!RMA__c.I_don_t_have_an_Account__c}" label="Don't have account">
                 <apex:actionSupport event="onchange" reRender="companyInfo"/>
                </apex:inputCheckbox>                      
           </apex:pageBlockSection>  
             
        
           <apex:pageBlockSection title="Company Details" columns="1" collapsible="true" id="companyInfo"> 
                <apex:inputField value="{!RMA__c.Company_Name__c}" label="Company Name"/>
                <apex:inputField value="{!RMA__c.Street_Address__c}" label="Street Address"/>
                <apex:inputField value="{!RMA__c.City__c}" label="City"/>
                <apex:inputField value="{!RMA__c.State__c}" label="State"/>
               <apex:inputField value="{!RMA__c.Zip_Postal_Code__c}" label="Zip/Postal Code"/>                
          </apex:pageBlockSection>     
                                      
            <apex:detail relatedList="false"/>
        </apex:pageBlock> 
        
    </apex:form>
</apex:page>
I want to render a Company Info section of the VF page based on checking a firld "I don't have an Account". Here is my VF page. Appreciate your help

<apex:page standardController="RMA__c" >
    <apex:form >
        
         <apex:pageBlock >
           <apex:outputLink value="/{!RMA__c.Id}" >Go Back to Case: {!RMA__c.Case_Number__c}</apex:outputLink>     
         </apex:pageBlock>
           
         <apex:pageBlock title="Create RMA">
             
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>      
             
            <apex:pageBlockSection title="Caller Details" columns="1" collapsible="false">
                <apex:inputField required="true" value="{!RMA__c.First_Name__c}" label="First Name"/>
                <apex:inputField required="true" value="{!RMA__c.Last_Name__c}" label="Last Name"/>
                <apex:inputField required="true" value="{!RMA__c.Phone__c}" label="Phone #"/>
                <apex:inputField required="true" value="{!RMA__c.Email_Address__c}" label="Email Address"/>
                <apex:inputField value="{!RMA__c.Case__c}" label="Case Number"/>
                <apex:inputField value="{!RMA__c.PO_Number__c}" label="PO Number"/>
                <apex:inputField value="{!RMA__c.Account_Number__c}" label="Account Number"/> 
                
                <apex:inputCheckbox value="{!RMA__c.I_don_t_have_an_Account__c}" label="Don't have account">
                 <apex:actionSupport event="onchange" reRender="companyInfo"/>
                </apex:inputCheckbox>                      
           </apex:pageBlockSection>  
             
        
           <apex:pageBlockSection title="Company Details" columns="1" collapsible="true" id="companyInfo"> 
                <apex:inputField value="{!RMA__c.Company_Name__c}" label="Company Name"/>
                <apex:inputField value="{!RMA__c.Street_Address__c}" label="Street Address"/>
                <apex:inputField value="{!RMA__c.City__c}" label="City"/>
                <apex:inputField value="{!RMA__c.State__c}" label="State"/>
               <apex:inputField value="{!RMA__c.Zip_Postal_Code__c}" label="Zip/Postal Code"/>                
          </apex:pageBlockSection>     
                                      
            <apex:detail relatedList="false"/>
        </apex:pageBlock> 
        
    </apex:form>
</apex:page>
 
Can someone help me get moving with some data validation please?

I would like to set a field as being conditionally read-only based on the value of a picklist. What I have is a picklist that shows the specific Account type. Based on that selection I would like to have some fields red-only so that I can enforce some level of process control.

I really appreciate your help in this regard.
I would like to conditionally hide few fields based on the value of a picklist. What I have is a picklist that shows the specific Account type. Based on that selection I would like to hide some fields so that I can enforce some level of process control.

I really appreciate your help in this regard.
I would like to conditionally hide few fields based on the value of a picklist. What I have is a picklist that shows the specific Account type. Based on that selection I would like to hide some fields so that I can enforce some level of process control.

I really appreciate your help in this regard.