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
Imtiaz PashaImtiaz Pasha 

Hi Guys , I have 80% coverage but at the deployment one error am getting below are the details .

test class :Milestone1_Project_Trigger_UtilityTest.
Method name :testHandleProjectDeleteTrigger.

this is the error :


System.DmlException: Delete failed. First exception on row 0 with id a062u000001PSZTAA4; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Project Milestone Template records are not allowed to be deleted from the system.: []
Stack Trace: Class.Milestone1_Project_Trigger_Utility.handleProjectDeleteTrigger: line 176, column 1 Class.Milestone1_Project_Trigger_UtilityTest.testHandleProjectDeleteTrigger: line 148, column 1.
VinayVinay (Salesforce Developers) 
Hi Imtiaz,

Try to check and skip validation rule 'Project Milestone Template records are not allowed to be deleted from the system' in your test class.

Looks like you cannot delete Milestone Records.  Review below idea link.

https://trailblazer.salesforce.com/ideaView?id=0873A000000cNwzQAE

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Imtiaz PashaImtiaz Pasha
NOT Understand..please can u give me a  exact solution 
VinayVinay (Salesforce Developers) 
Try to check if you have any validation rule with above error message.

If you are trying to delete any milestone record in your test class you might get this validation rule.

Use exception to skip validation error in your test class.

Thanks,
Vinay Kumar