I have a formula field set up to read the String/Text value of a Formula field on a record for the comparison in a Restriction Rule.
When I enable the rule and access a record that should be accessible by a User that meets the user qualification of the Restriction rule, I get this error on the record page and in a flow that attempts to access the same record:
Looks like there's a problem.
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. ui.services.connection.api.PartnerConnectionException: UNKNOWN_EXCEPTION: An unexpected error occurred.
For what it's worth, here's the XML of the restriction rule:
<?xml version="1.0" encoding="UTF-8"?>
<RestrictionRule xmlns="http://soap.sforce.com/2006/04/metadata">
<active>true</active>
<description>Users with the MHC View Only New Cases permission will be restricted to viewing cases with status &quot;New Case&quot;, even if they own them.</description>
<enforcementType>Restrict</enforcementType>
<masterLabel>MHC View Only New Cases</masterLabel>
<recordFilter>Status_Text__c='New Case'</recordFilter>
<targetEntity>HR_Case__c</targetEntity>
<userCriteria>$Permission.MHC_View_Only_New_Cases=true</userCriteria>
<version>1</version>
</RestrictionRule>
userCriteria
have to reference a property of the running user via $User.xxx ? I realize $Permission is a property of the running user but maybe the beta doesn't yet support that? Could you create a checkbox formula field on User that was $Permission.xxx and ref that field inuserCriteria
?