Skip to main content
Hi,

I have a VF page. I need to populate a list of contacts in a picklist. by changing it the fields name, phone should be prefilled. there is also an option to create a new contact. 

Is there any easy way to achieve this?

thank you!
1 respuesta
  1. 11 may 2018, 7:17 p.m.
    Hi Hope,

    The exact code for VF page and its controller class would be too long to write. But yes, it aint that to achieve.

    The following code snippet will help you.

    <apex:selectList size="1" value="{!SelectedContact}">

    <apex:actionSupport event="onchange" action="{!CallYourControllerFunctionHere}" reRender="Give IDs of the section which you want to rerender" />

    <apex:selectOptions value="{!Contactlist}"/>

    </apex:selectList>

    https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_intro.htm

    Use this link to better understand the apex components(tags)

    let me know if it helps.

    Thanks.