You need to sign in to do that
Don't have an account?

error: expecting right curly bracket
Hello,
what am I doing wrong here on line 12
for(RecordType rt: AccrTypes(
I get the following error
Error: Compile Error: expecting right curly bracket, found 'for' at line 12 column 3
public with sharing class CreateSampleData{ //Query for the Account record types List<RecordType> AccrTypes = [Select Name, Id From RecordType where sObjectType='Account' and isActive=true]; //Query for the Contact record types List<RecordType> Cntrtypes = [Select Name, Id From RecordType where sObjectType='Contact' and isActive=true]; //Create recors for(RecordType rt: AccrTypes){} }
I have written code before this one I cannot tell what the problem is...
Use the for loop inside a method.