I have the following SOQL which when run in Query Editor returns 1 record
Select Id, Name from Product2 where ProductCode = 'PKGA'
But when I use the sampe query in an Apex test, there are no records returned.
List<Product2> ProdList = [Select Id, Name from Product2 where ProductCode = 'PKGA'];
2 answers
Hi Jon,Please follow below vode:-
if you need any assistanse, Please let me know!!List<Product2> ProdList = [Select Id, Name from Product2 where ProductCode = 'PKGA'];
system.debug('ProdList Size ->> '+ProdList.size());
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh