How to filter a SOQL query by two or more fields (key fields)? For example let's say I have an object with three fields: Person (String), Year (String) and Income (Number). Person and Year are key fields. And there are four records in the object:
Person Year Income
'Jhon' '2016' 1000
'Jhon' '2017' 950
'Mike' '2016' 1100
'Mike' '2017' 900
Then I want to retrieve data about Jhon's income in 2016 and Mike's income in 2017
In some SQL implementations I can do it in such way:
Select Person, Year, Income From MyObject Where (Person, Year) In (('Jhon', '2016'), ('Mike', '2017'))What about SOQL? I was told that it won't accept such a query. Is there any means? Or I have to use "And" filter separately for every field and then use a loop?
Data Not Available The data you were trying to access could not be found. It may be due to another user deleting the data or a system error.
someone has happened?
Hi all, i am trying to write a test method for a private method and my test methods is in seperate test class.My methosd has a "private static" modifier but after writing test method as
static testMethod void test_getRestrictedProfileSet()
ProductsAndServicesController testgetprofile=new ProductsAndServicesController();
i am getting this error::::::Error: Compile Error: Method is not visible: [ProductsAndServicesController].getRestrictedProfileSet() at line 16 column 27...............................can anybody help me in solving this problem.It will be so helpful for me.