1

I am trying to Complete the Trailhead Challenge of Chatter basics (Approving Records from the Feed )

While checking the Challenge I am getting Error

Challenge Not yet complete... here's what's wrong: There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30128000000LoRJ. Contact your administrator for help.: []

I tried to investigate the debug log enter image description here

Then I tried to insert case from Anonymous window

Case c  = new Case(subject='a');
insert c;

It was also thrwing the same Exception

Line: 2, Column: 1 System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30128000000LoRJ. Contact your administrator for help.: []

  • 2
    Check if there is any process builder active. deacctive that and try. – Tushar Sharma Mar 12 '16 at 13:39
  • Thanks @Tushar . It worked. I checked all possibilities. Only Process builder was left. that was older version which was active. Thank you so much. – SFDC shaikh Mar 12 '16 at 13:48
2

The root cause here is in process builder if we are using some fields and in test class data those fields are blank then we get this error if we create data which have all fields populated used in test class then you will not face this error.

Also if you face same error with your live system then you should have received an email. In the email SF provide details which field or action causing the issue.

| improve this answer | |
  • Yeah It worked. – SFDC shaikh Mar 12 '16 at 14:25
  • i am facing this when running test class.it go away after deactivate it but is this the elegant way?so in the production we need to deactivate process builder everytime we want to deploy the class? – unidha May 24 '16 at 5:30
  • 1
    @unidha can you post this as new question and provide some details. You can refer this question. – Tushar Sharma May 24 '16 at 6:39
  • 1
    Deactivating a Process builder flow should not be a solution – sskular Oct 13 '16 at 12:53
  • 1
    @sskular i have already added few updates in my answer. You should check that. – Tushar Sharma Oct 13 '16 at 14:30
4

If anyone is still looking for a better answer in this thread... here you go.

You might get this error if the SObject (that you're inserting ) has an active Process Builder that expects certain fields to have values and those field values are NOT supplied before inserting them.

Try to pack all the necessary fields for the SObject that are required by process builder. You don't need to deactivate the process builder

If you have record types set for that SObject make sure you supply the appropriate record type while packing field values.

| improve this answer | |
1

We may not deactivate process builder every time we clash with this kind of exceptions as in most of the cases, fields of the respective object that are being used by this process builder have no values provided while creation or on update of object. If we could provide legitimate value to those fields, it will surely work...!

Thanks...!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.