2

I have a difficult troubleshooting situation involving a new accounting managed package, a complex flow, a mysterious validation error, and unit tests.

I had built a custom REST API before the accounting package was installed and all the Apex and unit tests were working fine.

The auto-launched flow (written by someone else) creates an accounting Billing record among other things. Now when I submit data to the REST API using Postman, my code does its processing as usual, but the flow fires in the middle of it. The flow completes successfully and the REST API method completes successfully.

However, when I run the REST API unit test, the flow fails with FIELD_CUSTOM_VALIDATION_EXCEPTION error "You must enter a value" when trying to create the Billing record.

I've deactivated all validation rules everywhere that have the message "you must enter a value", but I'm still getting the FIELD_CUSTOM_VALIDATION_EXCEPTION flow error in the unit test.

The validation rules are all part of the managed package, but I've verified that they're deactivated. I can't get enough detail in the debug logs to clarify any further.

Is there any other functionality or Apex exception that throws FIELD_CUSTOM_VALIDATION_EXCEPTION errors? Is there some way that inactive validation rules can still be applied by Apex?

Here's the only debug detail I have from the flow fault message:

09:36:23.216 (8753003474)|FLOW_VALUE_ASSIGNMENT|70014d9d24c3456d40e346e32ed516cba2b74bb-480c|Create_Billing|false
09:36:23.216 (8753253176)|FLOW_ELEMENT_FAULT|Fault path taken.|FlowRecordCreate|Create_Billing
09:36:23.216 (8760121645)|FLOW_BULK_ELEMENT_LIMIT_USAGE|1 DML statements, total 8 out of 150
09:36:23.216 (8760146016)|FLOW_BULK_ELEMENT_LIMIT_USAGE|1 DML rows, total 12 out of 10000
09:36:23.216 (8764410620)|FLOW_BULK_ELEMENT_LIMIT_USAGE|32611 bytes heap size, total 158695 out of 6000000
09:36:23.216 (8764457253)|FLOW_BULK_ELEMENT_END|FlowRecordCreate|Create_Billing|0|275
09:36:23.216 (8764496274)|FLOW_ELEMENT_BEGIN|70014d9d24c3456d40e346e32ed516cba2b74bb-480c|FlowAssignment|Assign_errorMessage
09:36:23.216 (8768183149)|FLOW_ASSIGNMENT_DETAIL|70014d9d24c3456d40e346e32ed516cba2b74bb-480c|errorMessage|ASSIGN|This error occurred when the flow tried to create records: FIELD_CUSTOM_VALIDATION_EXCEPTION: You must enter a value. You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.
09:36:23.216 (8768211981)|FLOW_VALUE_ASSIGNMENT|70014d9d24c3456d40e346e32ed516cba2b74bb-480c|errorMessage|This error occurred when the flow tried to create records: FIELD_CUSTOM_VALIDATION_EXCEPTION: You must enter a value. You can look up ExceptionCode values in the <a href='https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#'>SOAP API Developer Guide</a>.
09:36:23.216 (8772018099)|FLOW_ELEMENT_END|70014d9d24c3456d40e346e32ed516cba2b74bb-480c|FlowAssignment|Assign_errorMessage
1

1 Answer 1

5

Please note that you get the same error code if you have Apex validations. For example, if your trigger calls:

MyObject__c.MyField__c.addError('message');

Any validation thrown using the above methodology will also yield:

FIELD_CUSTOM_VALIDATION_EXCEPTION

1
  • The managed package vendor confirmed that their code used addError to throw those errors. Sep 4, 2019 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .