I created a custom field in an object a long time ago and now I want to delete it, so I go to Setup > Object Manager > {OBJECT} > Fields and Relationships, and where the field is, I click the dropdown and select Delete.

After the warning about losing data, I get the following error message:

Unable to Complete the Requested Change
Your changes could not be completed for the following reasons: 

This custom field is referenced elsewhere in salesforce.com.

Field Set

The Field Set is a hyperlink with the following code: {SALESFORCE_INSTANCE}/one/one.app#/alohaRedirect/0IXi0000000Cewf?retURL=%2Fsetup%2FObjectManager%2F01Ii0000000Gnv7%2FFieldsAndRelationships%2Fview&isdtp=p1

When I click it, it takes me nowhere. The ids in this action url point to the same object I was modifying.

My question is: how can I figure out where my custom field is being used so I can delete it?


As per the Winter'16 Salesforce Release Notes, and this still holds true,

Field sets aren't available in Lightning Experience. If you or someone in your organization created a field set while using Salesforce Classic, you see the global variable for field sets in places such as formula fields and Visualforce pages, but you can’t manage them in Lightning Experience.

This implies that you may need to switch to the classic interface using the Switch to Salesforce Classic option by clicking your View Profile button on the top right hand corner, in order to remove the field by modifying the field set.

Then switch back to Lightning Experience in order to address the dependency and then proceed with deleting the respective field.

Also found this Idea on IdeaExchange to allow Field Sets navigation in Lightning Experience.

Understand the pain but that's the bitter truth for now!

|improve this answer|||||
  • This wasn't exactly what I asked, but it solved my problem. Thank you! – RommelTJ Jun 21 '18 at 15:46
  • I am glad I could help.. – Jigar Shah Jun 21 '18 at 19:05
  • My understanding is that your issue was associated with field deletion which was not going through due that field being included in the field set. Since field sets are inaccessible in LEX and can only be manipulated in Classic hence the proposed solution. – Jigar Shah Jun 21 '18 at 23:14

I don't know of any easier way to do this, but I have a script solution:

SObjectType sobjType = Account.SObjectType;
String sobjField = 'Name';
for(FieldSet fs: sobjType.getDescribe().fieldsets.getMap().values()) {
    for(FieldSetMember fsm: fs.getFields()) {
        if(fsm.getFieldPath() == sobjField) {
            System.debug('Field is used in: '+fs.getName());

To use this, open up the Developer Console (Lightning: Gear Icon, Classic: Your Name), go to Debug > Open Execute Anonymous Window. Change the word Account to whatever object you're using, and 'Name' to the name of the field, and then Execute the code with the "Open Log" box checked, and then click on the Debug Only checkbox. In the end, you'll end up with the following output:

Sample debug log

From there, you'll know which Field Sets you need to modify or delete.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.