You need to sign in to do that
Don't have an account?
Suneel14
How to Check duplicate Name from VF page
Hi ,
I have create a VF Page on page i am fetching First Name, Last Name ,User Name from My custom Object User
i want when i type username if that user name is already stored in user record then it will show a message this user name already exist .
Thank You !!
You can use Action support to call a method of a controller
<apex:inputText value="{!productName}" id="productName" > // in this input field you can enter your user name
<apex:actionSupport event="onkeypress" action="{!searchProducts}" rerender="productSelection"/>// when ever you press key in the above input field and call a method "searchProducts" of your controller which is associated with your page.
</apex:inputtext>
In the controller you can check for duplicate of username and return message to your VF page
All Answers
You could use an apex:actionSupport to push an onChange event on the textbox through to a method that queries your object for duplicate names.
-Andy
You can use Action support to call a method of a controller
<apex:inputText value="{!productName}" id="productName" > // in this input field you can enter your user name
<apex:actionSupport event="onkeypress" action="{!searchProducts}" rerender="productSelection"/>// when ever you press key in the above input field and call a method "searchProducts" of your controller which is associated with your page.
</apex:inputtext>
In the controller you can check for duplicate of username and return message to your VF page
Thank you !! Abhishek
Please accept this as Solution, if you think this is useful for you