function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nithin Krishna Juturu 5Nithin Krishna Juturu 5 

System.DmlException: Delete failed. First exception on row 0 with id 0016F00001uHOilQAG; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Cannot delete account with related opportunities

Build Discount Calculator 
Last Task 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: Delete failed. First exception on row 0 with id 0016F00001uHOilQAG; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Cannot delete account with related opportunities.: []
Nissam PSNissam PS
It seems from the error that there is an existing custom validation rule which is restricting the DML from taking place. Can you please check the existing validation rules on account and try deactivate it.

Thanks!
Nithin Krishna Juturu 5Nithin Krishna Juturu 5
There are no custom validation rules on account object
Nissam PSNissam PS
Do you have any custom triggers on account object which prevents the deletion of an account if it has related opportunities?
Nithin Krishna Juturu 5Nithin Krishna Juturu 5
Thanks Nissam PS it solved the issue
because of the custom trigger it showed the error