I am trying to query a custom object using two variables. I used the following piece in my apex code and looked at the logs in dev console
id Pgm = 'a1Tm0000000DtjIEAS'; public list<Phone__c> lstPhone; lstPhone = new list<Phone__c>(); lstPhone = [Select id,Account__c,Program__c from Phone__c where Program__c =: Pgm limit 1];
When i try to print the size of the list , it shows null. Ideally it should have returned an object as i have a matching object for the criteria.
It also shows up when i query the Phone object with the following query(using fuse IT), i get one matching result
Select id,Account__c,Program__c from Phone__c where Program__c ='a1Tm0000000DtjIEAS' limit 1
I am not sure why i am not getting the result from my apex class. Is it because it is trying to match the 15 digit id and the 18 digit id.