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
Aivaras Geraltauskas 1Aivaras Geraltauskas 1 

Can't Delete a Custom Object

Hi,

I am trying to delete a custom object but I am met with this error 
User-added imageAny ideas what this means and what i need to do in order to delete the object?

Thanks,
Aivaras.
SwethaSwetha (Salesforce Developers) 
HI Aivaras,
Are you trying to delete custom object of any managed package?
Looks like the fields of this object are being referenced in your org which is why you are unable to proceed further.

You can use metadataAPI to retrieve the Apex code  (https://help.salesforce.com/s/articleView?id=000352004&type=1)from your organization and run a search with those fields for identifying dependency.

If this information helps, please mark the answer as best. Thank you
Aivaras Geraltauskas 1Aivaras Geraltauskas 1
Hi Swetha,

thanks for your reply!

I actually decided to delete all of the custom fields on the object first and found that some of the fields were referenced in some places. 

Regards,
Aivaras.
Vaddi Kasulu PinniboinaVaddi Kasulu Pinniboina
Hi Aivaras,
The image that was uploaded by you contains one message
VALIDATION ERRORS WHILE SAVING RECORD(S)

Go and check this link once   
https://help.salesforce.com/s/articleView?id=sf.fields_about_field_validation.htm&type=5


I hope you find the above link helpful. If it does, please mark it as Best Answer to help others too.

Thanks and Regards