Use Case:
- Approval Process on custom object
- Approval Assignment Email Template: Visualforce
User clicks Submit for Approval, SFDC responds with Internal Server Error.
Question will be self-answered as a service to the community.
Fortunately, SFDC Help had the clue, pointing me to an issue with the VF email template
VF template had markup like below:
<apex:outputText value="{!$ObjectType.Foo__c.fields.Industry__c.Label}"/> <apex:outputField value="{!relatedTo.Industry__c}"/> Developer then deleted field Foo.Industry__c. SFDC does not tell you that the field is being used in a VF Email template in the way above - no warning.
When Submit for Approval is then clicked, the gack ensues because, after Industry__c was deleted, the VF markup looks like the below:
<apex:outputText value="{!$ObjectType.Foo__c.fields.00NR0000001Zu8o.Label}"/> <apex:outputField value="{!relatedTo.00NR0000001Zu8o}"/> where 00NR0000001Zu8o is the id of the deleted field
Solution is to fix the VF email template and remove the offending, deleted field.