Visualforce Email Alert Workflow rule throws IllegalStateException ISE when triggered through site.com site or community
Last updated 2022-02-10 ·Reference W-2217072 ·Reported By 20 users
Visualforce Email Alert Workflow rule throws IllegalStateException ISE when triggered through a site.com site or community site.com site.
"Could not upsert record due to an unexpected exception: UNKNOWN_EXCEPTION: UNKNOWN_EXCEPTION: java.lang.IllegalStateException Must be a valid Exception"
NOTE: This Visualforce issue in Communitities can also cause other symptoms, such as the following:
Error: This page is unavailable
This occurs when Community Users try to access a record page that is overridden by Visualforce (overriding the New or View of an object with Visualforce).
1. Go to Setup | Administer | Communication Templates | Email Templates.
2. Create a basic Visualforce email template in any public folder.
3. Go to Setup | Build | Create | Workflow & Approvals
4. Create a new workflow rule against any standard or custom object (e.g. Case)
5. Create a new email alert action for the rule (Immediate workflow action):
6. Make sure the workflow rule in #4 is active.
7. Create a site.com site.
8. Create a page.
9. Add a form to the page, and select the object from #4 as the force connection (e.g. Case).
10. Add the minimum required fields for the case e.g. Subject, Description etc.
11. Preview the page, fill out the fields, and submit the form.
- Use HTML or text emails until this is resolved.
- Use a Time-Dependent Workflow Action rather than Immediate.
- Disable Visualforce overrides on the object
This bug is fixed as part of Parent Bug.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.