• khushi ahuja
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hey,
My usecase is  create a text space wherein user can search for contacts, as soon as user starts to type show records matching that criteria so that he can select the contact. (Similar to how you perform a google search, the moment you type in the recommended results are available to select in order to complete the text for search).
I have my query as below but i want search functionality such that recommended results should be available. plz help
string searchquery = 'select id,FirstName,Email from Contact where FirstName LIKE \'%'+searchName +'%\' AND AccountId = \''+acc.Id+'\'';
Hi, 
I want to develop a page which has two radio button as options : radio1  and radio2 . on click of radio1 a form of account should be avaialble and on click of radio2 a form of contact should be available. 

I have my code but on click of both radio button it is redirecting to contact page only. can u help me to solve my issue

<apex:page controller="AccController">
 <apex:form >
 <apex:pageBlock id="pgblk"> 
 <apex:selectRadio id="radioid" layout="pageDirection">
 <apex:selectOption  itemLabel="radio1" itemValue="1"></apex:selectOption>
 <apex:actionSupport event="onclick" action="{!AccForm}">
 </apex:actionSupport>
 
 <apex:selectOption itemLabel="radio2" itemValue="2"></apex:selectOption>
 <apex:actionSupport event="onclick" action="{!ContForm}">
 </apex:actionSupport>
 </apex:selectRadio>
 
 </apex:pageBlock>
 </apex:form>
</apex:page>

Here is my controller
public class AccController 
{
 public PageReference AccForm()
 {
 PageReference Page = new PageReference('/apex/CreateAcc');
 Page.setRedirect(true);
 return Page;
 }
 
 public PageReference ContForm()
 {
 PageReference Page = new PageReference('/apex/CreateContact');
 Page.setRedirect(true);
 return Page;
 }
}