In apex I try to create a person account. For the field linked to the account it's ok, but when I want to fill the contact field (a field like myfield__pc) it does not work. Here is basically what I did :

Account compte = new Account();
compte.BillingStreet = 'test;
compte.BillingCity = 'test';
compte.Job__pc = 'myjob';
//etc, and i insert the account

In salesforce I can visualize the new account, all the fields are filled except the ones concerning the contact (in this case, Job__pc is not filled...)

How can I fill theses kind of fields ?

  • I did a test and it just works. Is there an error you are facing? Also can you post your complete code as this one seems just an example.
    – Jayant Das
    Commented Feb 22, 2019 at 15:53
  • Did you set the correct record type? That could cause a problem.
    – sfdcfox
    Commented Feb 22, 2019 at 17:07


You must log in to answer this question.

Browse other questions tagged .