+ Start a Discussion

test class error

public RecTypes__c getPersonRecordType(String accountName)

{ RecTypes__c PersonAccRecordType=[SELECT Name,Record_Type_Value__c FROM RecTypes__c WHERE name=:accountName limit 1]; return PersonAccRecordType; }


In the above code i am trying to fetch the where i am trying to fetch rows using record types...

       when i am executing my test class its telling me now rows to fetch.......

      an then it is pointing to this particular method...

      When i am executing my test class queries they are getting inserting properly

   Please help me with this.....




Ankit AroraAnkit Arora

Code provided is not sufficient for me to understand the problem, still I would like you to ensure that when you are inserting the account in your test class it should have a record type assigned. If won't get rec type assigned automatically if there is no default rec type set for the profile. Still would like to see a bit more piece of code if it doesn't resolved your problem.



Ankit Arora

Blog | Facebook | Blog Page