I'm trying to create a person account in apex, but I have a problem. The fields like firstName, lastName are completed OK but the fields like PersonMailingPostalCode or fields like XXXX__pc aren't completed.

I post a sample of my code:

Account personAcc = new Account();
personAcc.firstName = 'Person';
personAcc.lastName = 'Account';
personAcc.BillingPostalCode = '23445';
personAcc.PersonMailingPostalCode = '29544';
personAcc.Job__pc = 'Quality control';
personAcc.RecordTypeId = RT_PERSONACCOUNT_ID;
insert listPersonAccounts;

I hope you can help me


  • what do you mean by not completed? are getting any error? – salesforce-sas Jul 26 '19 at 9:12
  • @salesforcesas no, i don't get any error, I mean that the value is not assigned to the field when the account is inserted – Javier Jul 26 '19 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.