You need to sign in to do that
Don't have an account?
harsha__c
Binding a variable between VF page and controller
Here is my Requirement
I given 'h' in the search field in VF page.
When i press the search button it should display the all Account Names starting with 'h' letter
In handler I have a variable of string type and is binded to the VF page.
Now my doubt is,
How to get the AccountNames starting with the letter stored in the string variable.....
Can anyone suggest me the way
I got the Answer
i.e.
select Name from Account where Name like : str ;
All Answers
Hi Hasha,
You can just make a SOQL query with like %% syntax
Let me be more clear
where i know that
select Name from Account where name like 's%' limit 10;
will work
But in my case, String str='s';
Now Can i run the same query by using the str instead of the regular pattern
I got the Answer
i.e.
select Name from Account where Name like : str ;
Thanks, Harsha Vardhan. This helped me too.