Loading

Validation Rules not enforced in Experience Site for Guest Users but records are not created

Udgivelsesdato: Oct 13, 2022
Beskrivelse
Guest Users trying to use, for example, a Contact Support Form in an Experience Site will be able to submit records with a "submission successful" message even when the input data should have triggered a Validation Rule.
However, records will not be created in the system and we receive the following email:
 
Subject: There is an issue with This Case 

Salesforce could not create this case because of the reason listed below. We will try creating the case again. For more information about this error or help with Web-to-Case, please contact Customer Support. 

Reason: support.cases.WebToCaseException: Error code=FIELD_CUSTOM_VALIDATION_EXCEPTION, message=Hey Guest User! Enter a case reason, fields=[Reason] 

Record Information: 
_quickActionName = NewCase 
_record = {"Status":"Unassigned","Description":"Test Case Guest User with Validation Rule","Priority":"Medium","Reason":"","Subject":"Test Case Guest User with Validation Rule"} 

Thank you! 

Customer Support 
salesforce.com, inc. 
The Landmark @ One Market, Suite 300 
San Francisco, CA 94105 
Løsning
This is currently working as designed.

The process of creating a case for Unauthenticated Users also known as Guest Users is different than the one in place for Authenticated Users.

All validation process, except checking for non-empty required fields in the form, is done on the server-side. For Guest Users these Case submissions don't have validation run until they are processed off of the queue. As you can see in the email with the error you receive, they're submitted as Web-to-Case records to Salesforce.

If you need to add validation criteria before Guest Users can submit cases in an Experience Site you'd need to create a custom component to replace the standard Contact Support form.
Vidensartikelnummer

000381943

 
Indlæser
Salesforce Help | Article