+ Start a Discussion

How to handle "No matches found." error message on inputField



I recently converted a page I had that used inputText components to obtain input to using inputFields instead because those include the lookup button. In the previous rendition of the page, I could easily handle the case in which no contact records with a name matching the one entered in by the user were found just by checking to see if the text in the box was null or empty. Now, it seems that if a matching record is not found, the message "Error: No matches found." pops up below the inputField box without running the method that is suppposed to be called when a commandButton is pressed. This makes it sort of difficult to handle this if it isn't running through any of the logic I've written to attempt to handle this. What I want the page to continue to do is to make a new record with the information inputted if a matching record is not found, but I can't seem to do that when it isn't running through the code like it is supposed to. Is there a way to handle this scenario through the page's controller so that I have the freedom to handle it in any way I wish?


I thank anyone that is able to help.

Best Answer chosen by Admin (Salesforce Developers) 



u can't remove this as this is tied to standard controller...you can acheive this by creating an input text and custom lookup icon functionality(means put an image and onclick open the account records as how it on standard)..and when ever user enters and clicked on the save then check if any record exits with the same name or not then create record ....