You need to sign in to do that
Don't have an account?
giri rockzzzz
comparing dynamic id in apex code....plz help
unexpexted token error is shown for the following code:
My id comes dynamically how can i write the query.....plz help
public class proitem{
public String getPro() {
String id = 'a0890000000BLihAAG';
it=[select name from item__c where product__c =id];
return it;
}
}
Are you getting the ID from a Visualforce Page?
If you are, then you can use ApexPages.currentPage().getParameters().get('id')
Else , try modifying the query as follows :
it=[select name from item__c where product__c = :id];
Hope it will be of some help!
All Answers
Are you getting the ID from a Visualforce Page?
If you are, then you can use ApexPages.currentPage().getParameters().get('id')
Else , try modifying the query as follows :
it=[select name from item__c where product__c = :id];
Hope it will be of some help!
Hello giri
Here is the code stuff for creating string Query sample and i think It may help for your scenario.
-Suresh
hello,
thanx for you help...even ur code works thank you very much