I have a formula field based on a date field, and I want to have the date field encrypted using Shield Platform Encryption. But when I try to turn the encryption on I get:
Error on fields update message=Encryption can't be enabled for fields referenced in the custom formula fields: Benefit Claimed.Years in Force at Date of Death. Make sure your permissions, fields, operators, and functions are compatible with encryption and try again. statusCode=FIELD_INTEGRITY_EXCEPTION fields=null
Part of the formula is:
YEAR(DateOfDeath__c) - YEAR(EffectiveDateOfCoverage__c)
Am I correct that I am stuck here, and that e.g. YEAR
is never amongst the:
... functions are compatible with encryption ...
mentioned in the error message?
I am trying to see if having all the fields referenced in a formula encrypted is a workaround for Platform encryption scratch org errors "common.exception.SfdcSqlException: ORA-00932: inconsistent datatypes: expected CHAR got DATE". But also having this field encrypted makes sense.
Apex
.