Do Not Destroy flag

A Do Not Destroy flag is provided in the DestructionRootPinnable delegate. If an entity implements this delegate, instances of the entity have a DoNotDestroy Boolean field. The default value of this field is false.

Note: If this field is on a Contact entity or a subentity of Contact, it is maintained only in ContactManager. Even if the contact is linked, the field is not sent to ContactManager, nor is it updated from ContactManager.

In the base configuration of ContactManager, the ABContact entity implements the DestructionRootPinnable delegate and therefore has a DoNotDestroy Boolean field. The default value of the field is false, which permits destruction of the entity. If this field is set to true, the entity cannot be purged.

You can set this field for ABContact and Contact objects. Use the markDoNotDestroy method to set the field. For example:

ABContact.markDoNotDestroy(true)