You need to sign in to do that
Don't have an account?
Patrick Mayer 4
Here is a relevant code snippet. I am most concerned with why the system.debug line returns false. Any insights would be great.
Creating and Using a Person Account
Account acct = new Account(RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Person Account').getRecordTypeId()); acct.Phone = o.Customers_Phone__c; acct.PersonEmail = o.Customers_Email__c; acct.FirstName = o.Customers_First_Name__c; acct.LastName = o.Customers_Last_Name__c; acct.Customer_Id__c = o.EatStreet_Customer_ID__c.toPlainString(); insert acct; system.debug(acct.IsPersonAccount); temp.Customer__c = acct.PersonContactId;
Here is a relevant code snippet. I am most concerned with why the system.debug line returns false. Any insights would be great.
When I've pulled the record type for a person account I've used the following code - its more low level but guarantees the record type returned is for a person account (it will also fail if it doesn't get a record type id matching the name, which might not be what you want) :