You need to sign in to do that
Don't have an account?
How to access member variables of class in webservice method?
Hi,
I want to use the class member variable in the webservice method.
global class test123 { List<Opportunity> selopplist1 = new List<Opportunity>(); WebService static void getFromListPage(String[] IdList) { SelOppList1 = [select Name, Account.Name, Type from opportunity where id in :IdList]; } }
Here I want to use selopplist1 in the webservice method, but I am getting an error like variable is not declared.
I tried by keeping global as well as webservice keyword before the declaration but still I am getting the same error.
Any help on this highly appreciated
Thanks Simon,
One more question,
I have a list button, on click of it I am sending the selected records IDs to the apex class by using the s-control.
In that apex class I am getting these rows, I want to display these records in that VF, how can I redirect it to the visualforce page. When I am redirecting using s-control view state is getting refreshed. So I am not getting any records, If I am trying to return through webservice method it is showing an error like Invalid return type: System.PageReference
Any help on this.