0

Given

  • Cross-object formula field My_Identifier__c on Case: Asset__r.My_Identifier__c

  • where Asset.My_Identifier__c is a text field, Shield-encrypted

  • HTML email template that looks like:

    Here is the identifier:{!Case.My_Identifier__c}<<

When

  • Email template rendered (using Send test and Verify Merge Fields) using a Case that references an Asset with a non-null value in Asset.My_Identifier__c

Then

  • Template renders as Here is the identifier:<<No merge field populated

How do I fix this?

1

As anyone using Shield encryption knows, there are all sorts of considerations documented here:

None of these are relevant

The workaround was surprising:

  • Create a new custom formula field on Case called My_Identifier_Clone__c. Copy-paste the exact same formula as in Case.My_Identifier__c.
  • Change the references to the formula field in the Email Template to be {!Case.My_Identifier_Clone__c}
  • Retest - email renders correctly

I suspect I could also have deleted the original formula field Case.My_Identifier__c and add back but this would be problematic to deploy through a Devops pipeline without two steps

1

Note:

  • Original troubleshooting involved changing the encryption settings and re-syncing all the records in a sandbox. This had no affect on the original issue.
  • We also confirmed that this was not a permission or sharing issues by logging in as multiple users with different settings.
  • In a metadata comparison the new and old field are exactly identical. The original field was created a few years ago, but everything else is the same.
1
  • this is not an answer but rather a comment on @cropredy answer – cropredy Oct 30 '20 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.