You need to sign in to do that
Don't have an account?
Abhishek Bhardwaj 9
Your attempt to delete My Test Account
Hi,
I'm going through "https://trailhead.salesforce.com/trails/force_com_dev_beginner/modules/apex_database/units/apex_database_dml" module and while implementing the challenge, I am getting following 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 0017F00000LQrpmQAD; first error: DELETE_FAILED, Your attempt to delete My Test Account could not be completed because it is associated with the following cases.: 00001036 : []
There is no account with name as "My Test Account" & no case with number as "00001036" visible in my org. Also, I am creating an account record why is it reflecting a message related to deleting of account? Please suggest.
Regards
I'm going through "https://trailhead.salesforce.com/trails/force_com_dev_beginner/modules/apex_database/units/apex_database_dml" module and while implementing the challenge, I am getting following 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 0017F00000LQrpmQAD; first error: DELETE_FAILED, Your attempt to delete My Test Account could not be completed because it is associated with the following cases.: 00001036 : []
There is no account with name as "My Test Account" & no case with number as "00001036" visible in my org. Also, I am creating an account record why is it reflecting a message related to deleting of account? Please suggest.
Regards
All Answers
public class AccountHandler {
public static Account insertNewAccount(string sampleAccountNew){
try{
{
Account myObj = new Account(name = sampleAccountNew);
insert myObj;
System.debug('Record inserted successfully');
return myObj;
}
}
catch(DmlException e){
System.debug('Error occured while creating account - '+e.getMessage());
return null;
}
}
}
Hi Abhishek,
Please try this hope it will help you.
Mark as a best if it helps you.
Regards,
Ajay