I have a table that I'm querying using SOQL and the query results should contain multiple rows. I'm trying to iterate through the query results and access attributes from each row of the query results. When I try to access the attributes using the dot operator, there is a pre-compiler error saying that the variable doesn't exist. Here is the code that is causing the error:
for(Available_records__c amc : [SELECT Id , Create_Period__c , Name, Record_Type__c, Frequency__c FROM Available_records__c WHERE Create_Period__c = TRUE]){
if(amc.Frequency_c == weeklyCampaign.frequency){
//Do some logic
}
}
How can the individual attributes from the rows in the query results be accessed?
if
statement.