I'm trying to delete a Contact using apex :

String stringId = '0031400002qCxIcAAK';
Contact record = Database.query('Select Id From Contact Where Id = :stringId');
delete record;

And I have this error :

FATAL_ERROR System.DmlException: Delete failed. First exception on row 0 with id 0031400002qCxIcAAK; first error: INVALID_PERSON_ACCOUNT_OPERATION, cannot reference person contact: []

  • You are working with Person Accounts? Dec 2, 2019 at 14:27
  • yes, i'm trying to delete person account created by web service. Dec 2, 2019 at 14:29

1 Answer 1


i would recommended go through Person Contact , person contact created/deleted automatically with Person Account, so person contact you can only modify, if you want delete Person contact you should delete person account then person contact delete automatically.

A person contact can be modified, but cannot be created or deleted. Since these kinds of contacts do not have their own record detail page, clients must redirect users to the corresponding person account (Account) page. SOSL results don’t include any of the contact fields enabled when IsPersonAccount is set to true. The contact ReportsToId field is not visible.

If you delete the account, the contact is also deleted. You cannot directly delete the contact; you must delete the account.

  • I understand the logic, thank you for your help ! Dec 2, 2019 at 14:43

You must log in to answer this question.

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