+ Start a Discussion

PROBLEM -- Hopefully someone can help!

I have an issue in SalesForce, where I added a custom field to a custom object in SalesForce about a month ago.  Then I determined a better strategy and went back to remove the field.  The system allowed me to remove the field; however, I am being haunted by a validation that is attached to that field.  I can't see this validation in the list, so I don't have the option to remove it.


Any ideas on what I can do to remove a validation that I can't see?


Did  you see if you can undelete the field?  I know you said "about a month ago" but is the field still there in the deleted fields for the object?  If so, undelete then troubleshoot.  I've never heard of this problem though.

Madhan Raja MMadhan Raja M


When we try to delete the Custom field we get the above page. Click on the Validation Rule link to see which Validation Rule is using the Custom field, modify the Validation Rule and delete the Custom field.


Madhan Raja M


As @Madhan Raja has pointed out if a field is referenced anywhere you can't delete the field. However, you have mentioned you deleted the  field a month ago and the validation rule is causing you issues. I am thinking how you could delete the field in the first place?


You can do this. Go to the recycle bin and undelete the field if it still exists there. Then delete the validation rule and then the field. 



I did a check and the field does not exist in the recycle bin.  I would also agree that I typically get a message regarding validations before deleting fields, but I am still getting a validation error on a field that no longer exists.


I might have to open a case on this one.


Ok try this. Go to Objects > Custom Field and Relationships 

This section should have link to deleted fields. Click. if your field exists there , erase it. 


It doesn't appear there either.


Can you post the exact error? So do whatever it was that causes the error and then take a screen shot and post because something doesn't seem right.


Ok so now can see that this looks like a VisualForce page and it has a custom button in it.  If this was done a while ago, it's possible the version of Apex isn't as tight as it is now.  Now it does a good job of checking all code before you delete a field.


The deleted field may be in that custom button/class called "Calculate".  Look in that button and see if there is a reference to the field or what Apex class it is pointing to.  Then you will have to look in that class and my hunch is you will find the field there.  You might break the formula but that's a different question.


If not, then do same with the VisualForce page.  If you are not familiar with editing classes or VF pages, that is another topic as you can't make changes in Production to classes. You'd have to use a Sandbox or another Developer tool if thats where the field is.