Problem
When attempting to submit a record for approval using CloudSense Click Approve, an error occurs:
"Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, [Custom validation rule error message]: [Field API Name]"
The approval submission is blocked, and the record does not enter the approval process.
Root Cause
A custom validation rule on the object (e.g., Opportunity, Quote, Order) is preventing the record from being updated when Click Approve attempts to submit it for approval. Validation rules are evaluated when records are inserted or updated, and if they fail, the operation is blocked.
Click Approve updates certain fields on the record when submitting it for approval (e.g., approval status, submission timestamp), and if a validation rule is triggered by these updates or by the current state of the record, the submission will fail.
Resolution
Step 1: Identify the Blocking Validation Rule
- Review the full error message to identify:
- The validation rule name or error message text
- The field that is causing the validation to fail
- Navigate to Setup > Object Manager
- Select the object type that is being submitted for approval (e.g., Opportunity, Quote, Order)
- Click Validation Rules in the left sidebar
- Locate the validation rule mentioned in the error message
Step 2: Review the Validation Rule Logic
- Open the validation rule
- Review the Error Condition Formula to understand when the rule is triggered
- Identify which field values or conditions are causing the rule to fail
- Check the Error Message and Error Location to understand what the rule is enforcing
Step 3: Correct the Record Data
Option A: Update the Record to Meet Validation Criteria
1. Open the record that is being submitted for approval
2. Update the field values to satisfy the validation rule criteria
3. Save the record
4. Retry the Click Approve submission
Option B: Temporarily Deactivate the Validation Rule (if appropriate)
1. If the validation rule is blocking legitimate approval submissions and needs to be reviewed:
- Navigate to the validation rule in Setup
- Uncheck the Active checkbox
- Save the validation rule
2. Retry the Click Approve submission
3. Important: Reactivate the validation rule after resolving the issue to maintain data quality
Step 4: Verify Approval Submission
- After correcting the record or adjusting the validation rule, retry the Click Approve submission
- Verify that the record enters the approval process successfully
- Check the approval history on the record to confirm the submission
Prevention
- Review validation rules to ensure they do not inadvertently block approval processes
- Use validation rule criteria that check the approval status (e.g.,
NOT(ISPICKVAL(Approval_Status__c, "Pending"))) to exclude records that are in approval - Test Click Approve workflows in a sandbox environment before deploying validation rules to production
- Document validation rule logic and communicate with approval process owners to avoid conflicts
Priyanka Bhotika
Comments