• BearDog515
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hello

 

I've searched the boards for an answer to this and couldn't find one.  I'm new to apex and programming in general so apologies if this is very basic...

 

I have the following test method in an apex class:

    public static testMethod void dateSetTest(){
        
        Lead prospect = new Lead(LastName = 'Test');
        Database.insert(prospect);
        
        Account acct = new Account(Name = 'Test');
        acct.recordTypeId = [SELECT Id FROM RecordType WHERE Na​me = 'Person Accounts'].Id;
        Database.insert(acct);
        
        Case c = new Case(AccountId = acct.Id,
                          Subject = 'Test',
                          Origin = 'Inbound Call',
                          Reason = 'Customer Inquiries',
                          Primary_Type__c = 'Test',
                          Primary_Subtype__c = 'Test',
                          Survey_Email_Sent__c = false);
        Database.insert(c);
        c.Survey_Email_Sent__c = true;
        Database.update(c);
        
        Account acctToCheck = [SELECT Id, Last_Survey_Sent__c FROM Account WHERE Id = :acct.Id];
        System.assert(acctToCheck.Last_Survey_Sent__c != null);
    }

 

I'm getting the following error which makes no sense at all:

 

Error: Compile Error: No such column 'Na​me' on entity 'RecordType'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

I am authoring this from a System Administrator profile so I don't believe it's a FLS issue.  Any thoughts or help would be appreciated.

 

Hello

 

I've searched the boards for an answer to this and couldn't find one.  I'm new to apex and programming in general so apologies if this is very basic...

 

I have the following test method in an apex class:

    public static testMethod void dateSetTest(){
        
        Lead prospect = new Lead(LastName = 'Test');
        Database.insert(prospect);
        
        Account acct = new Account(Name = 'Test');
        acct.recordTypeId = [SELECT Id FROM RecordType WHERE Na​me = 'Person Accounts'].Id;
        Database.insert(acct);
        
        Case c = new Case(AccountId = acct.Id,
                          Subject = 'Test',
                          Origin = 'Inbound Call',
                          Reason = 'Customer Inquiries',
                          Primary_Type__c = 'Test',
                          Primary_Subtype__c = 'Test',
                          Survey_Email_Sent__c = false);
        Database.insert(c);
        c.Survey_Email_Sent__c = true;
        Database.update(c);
        
        Account acctToCheck = [SELECT Id, Last_Survey_Sent__c FROM Account WHERE Id = :acct.Id];
        System.assert(acctToCheck.Last_Survey_Sent__c != null);
    }

 

I'm getting the following error which makes no sense at all:

 

Error: Compile Error: No such column 'Na​me' on entity 'RecordType'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

I am authoring this from a System Administrator profile so I don't believe it's a FLS issue.  Any thoughts or help would be appreciated.