+ Start a Discussion
ExploreForceExploreForce 

Visualforce page:<apex:actionfunction>

<apex:page standardController="Request__c" extensions="LocationRequestController" sidebar="false">
<apex:form id="theform">
    <apex:pagemessages id="errorMessage"/>
    <apex:pageBlock >
    <apex:pageBlockButtons location="top">
        <apex:commandButton status="statusId" value="Save" action="{!Save}" />
        <apex:commandButton status="statusId" value="Save & Create Order" action="{!SaveAndCreateOrder}" />
        </apex:pageBlockButtons>
        <apex:pageBlockSection id="Atts">
      <apex:pageBlockSectionItem >
            <apex:outputLabel for="attribute-search-status" value="User"/>
            <apex:outputPanel styleClass="requiredInput" layout="block" >
             <apex:outputPanel styleClass="requiredBlock" layout="block"/>
              <apex:selectList id="attribute-search-status" value="{!selectedUser}" required="true" size="1" style="width:180px">
                <apex:selectOptions value="{!Users}"/>
              </apex:selectList>  
              </apex:outputPanel>   
            </apex:pageBlockSectionItem>
          
       <apex:inputField value="{!ReqUser.Location__c}" required="true"/>
      
             <apex:pageBlockSectionItem >
              <apex:outputLabel for="attribute-search-status" value="Categories"/>
            <apex:outputPanel styleClass="requiredInput" layout="block" >
             <apex:outputPanel styleClass="requiredBlock" layout="block"/>
              <apex:selectList id="attribute-search-status" value="{!selectedCategory}" size="1" required="true" style="width:180px">
                <apex:selectOptions value="{!Categories}"/>
              </apex:selectList>        
              </apex:outputPanel>   
            </apex:pageBlockSectionItem>
      
            <!--<apex:actionFunction action="{!createServiceAgreement}" name="pServiceAgreement" reRender="pServAgreement" />-->
           <apex:inputField value="{!ReqUser.ServiceAgreement__c}" required="true"/>
         
            </apex:pageBlockSection>
         </apex:pageblock> 
       
   </apex:form>    
</apex:page>

I need to populate : <apex:inputField value="{!ReqUser.ServiceAgreement__c}" required="true"/> based on below fields:
Location__c and Categories
How to use <apex:actionfunction>.Pls help

           <apex:inputField value="{!ReqUser.Location__c}" required="true"/>
     
             <apex:pageBlockSectionItem >
              <apex:outputLabel for="attribute-search-status" value="Categories"/>
            <apex:outputPanel styleClass="requiredInput" layout="block" >
             <apex:outputPanel styleClass="requiredBlock" layout="block"/>
              <apex:selectList id="attribute-search-status" value="{!selectedCategory}" size="1" required="true" style="width:180px">
                <apex:selectOptions value="{!Categories}"/>
              </apex:selectList>       
              </apex:outputPanel>  
            </apex:pageBlockSectionItem>

I need to populate : <apex:inputField value="{!ReqUser.ServiceAgreement__c}" required="true"/> based on below fields.
How to use <apex:actionfunction>.Pls help
ExploreForceExploreForce
Pls anyone can help on this?
asish1989asish1989
Hi 

This the link you can refere

http://salesforceworld4u.blogspot.in/2014/09/how-to-check-list-size-in-visualforce.html

In this post based on some input field value we are populating one pageblock table. for your case you need to populate another input field.

In the method you need to write little bit extra logic 
ReqUser.ServiceAgreement__c = your logic to populate based on location fileds

Mark it best solution If it solves your requirement for other benifit.

Thanks
Asish