You need to sign in to do that
Don't have an account?
Scott0987
get a list of all products
I would like to get a list of all of the products in the org so that I can work with it. I have tried:
list<product2> pl = [select name, id from Product2];
but I am only getting a few products not all of them. Any idea how I can do this?
Hi
you query is correct. I didn't find any mistake in your query. your getting few records because of OWD settings. please check your settings.
All Answers
i.e., if you want to extract deleted ones, with all rows, like,
list<product2> pl = [select name, id from Product2 all rows];
Second, did you execute this query from Execute Anonymous directly?
If you get results from VF page or Apex class, sharing setting may hide some records based on the users.
Hi
you query is correct. I didn't find any mistake in your query. your getting few records because of OWD settings. please check your settings.
I figured out what was happening. when I put system.debug(product2) it was not displaying the entire list it was just some of them followed by .... so it was working. thanks for the help.