0

In my org, we have enabled PersonAccount.

Now it seems like we can no longer create an ordinary Contact.
this simple code

Contact test = new Contact();
test.email = '[email protected]';

system.debug(test);

is throwing this kind of error
enter image description here

is there any way to create a 'standard' contact like we normally could like when personAccount hadn't been enabled ?

1
  • An org with person accounts enabled still has the ability to use the normal Contact object and its fields... your error is most likely because you named your variable test which is a system class name too. Change test to some other name and try again. salesforce.stackexchange.com/a/209183/660
    – Mark Pond
    May 15, 2023 at 18:17

2 Answers 2

0

PersonAccounts are pretty tricky to manage. I'm listing the Considerations for PersonAccounts article for your info - although it doesn't directly help you with this question, it should help you understand what changes are made when PersonAccounts is enabled on SF.

Go to the Contacts object in Setup directly, and see what fields are listed on the object, and also check Accounts and PersonAccounts, which is its own object. The PA object is supposed to be a combination of Account and Contact fields.

I'm responding from memory - I don't have immediate access to a PA org, but I remember the mission it was to reconcile all the Account/Contact structures and connections when I did.

0

Ah, I got it. It's because I was creating an Apex Class with the name Contact. The compiler thought I was instantiating the custom Contact class instead of the SObject.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .