• exia
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi, 

 

Below is my sample code for test class:

 

@isTest(seeAllData=true)
private class CtrlTourPlanningWithFilters_Test {
 
    static testMethod void CtrlTourPlanningWithFilters_PL_User_Test() {
        String RecTypeId= [select Id from RecordType where (Name='Person Account') and (SobjectType='Account')].Id;
 
Account Accnt = new Account(
 RecordTypeID=RecTypeId,
 FirstName='Test FName',
 LastName='Test LName',
 PersonMailingStreet='test@yahoo.com',
 PersonMailingPostalCode='12345',
 PersonMailingCity='SFO',
 PersonEmail='test@yahoo.com',
 PersonHomePhone='1234567',
 PersonMobilePhone='12345678' 
);
 
insert Accnt;
system.debug('@@@' + Accnt.isPersonAccount);
 
    }
}
 
When I check the debuglog, the "isPersonAccount" is set to false. Am I doing something that is not right?
 
Thanks,
Dane
  • October 30, 2013
  • Like
  • 0