Hi Saurabh,
I think you can only do this with a validation rule if the object in question is the child in a master-detail relationship. If so:
Set up a rollup summary field on the parent object which counts the number of child records.
Set up a validation rule on the parent object which prevents the rollup field value from decreasing:
If that doesn’t work, a simple trigger will:
trigger DeletePrevention on MyObject__c (before delete) {
for (MyObject__c mo : Trigger.old) {
mo.addError(‘Unable to delete record!’);
}
}
Thanks