24

I want to remove the Record Type applied to a Custom Object. There will be no record types at all.

I cannot remove one of the record types because its set to the default for several profiles (in fact all profiles). Therefore it seems like I have to manually enter each profile and delete it. Joy.

However, for Chatter type profiles I don't have the option to enter "Object Settings". So I can't remove it it from these profiles. Which means I can't remove the Record Types attribute at all.

Any ideas how to get around this?

Ideally I'd like a page, like the one I was offered when I created the record type, that lists all profiles and has a picklist for each row ('default on' or something).

The only "solution" I found was this: https://success.salesforce.com/answers?id=90630000000h2pXAAQ which seems like its out of date now. I can't navigate to a setup/ui/profilerecordtypeedit.jsp page as described in that link.

  • Have anyone tried to remove recordtype using metadata? – unidha Dec 1 '15 at 8:04
  • I don't think that will work. It's a Salesforce feature that record types cannot be destroyed via metadata API. This is probably because a replacement record type has to be provided, which requires user interaction. – powlo Dec 1 '15 at 13:10
35

Clues came from here:

http://sfdciq.com/unable-to-delete-record-type/

The solution is a URL hack.

https://xxx.salesforce.com/setup/ui/profilerecordtypeedit.jsp?id={Profile ID}&tid={Custom Object ID}&pn={Profile Name}

Eg,

As a System Administrator, I go to Setup > Profiles > the profile I'm interested in. Lets say "Chatter External User"

The url for this profile contains the Profile ID: https://xxx.salesforce.com/00e20000001nAgo

I also have to copy the Profile Name: "Chatter External User"

Then I go to Setup > Create > Objects > the object I'm interested in. Let's say "Custom Object"

Again the url contains the tid:

https://xxx.salesforce.com/01I20000000y7Hh?setupid=CustomObjects

My final hacky URL is:

https://xxx.salesforce.com/setup/ui/profilerecordtypeedit.jsp?id=00e20000001nAgo&tid=01I20000000y7Hh&pn=Chatter+External+User

NB For Standard Objects the parameter tid is the name of the object "Contact", "Account", Opportunity" etc. For Custom Objects its the ID of the Custom Object.

I can now remove the unwanted Record Type from "Selected Record Types".

Simple wimple.

  • I have tried using this URL hack method, but not able to do so. I am facing error message as 'Unable to Access Page'. Here is my hack URL cs20.salesforce.com/setup/ui/… , The first Id is the profile Id and the second one is custom object Id. I think salesforce has noticed this and blocked the user to access the page. Any thoughts would be helpful! – Krishna Bidwai May 25 '16 at 7:00
  • The return url was missing so I have added it and It worked like Charm! Thanks for the info. – Krishna Bidwai May 25 '16 at 7:20
  • you can skip the last part with the name &pn=Chatter+External+User. Just keep the ObjectID & ProfileID in the URL link – BBK Dec 20 '19 at 14:58
2

Before following those steps, try the following:

Setup > Customize > User Interface > 

Disable  > Enable Enhanced Profile User Interface

Then follow the instruction, you should be able to get to the page where you can remove the record type.

  • 1
    This doesn't work unfortunately. Chatter profiles do not list "Record Type Settings". – powlo Sep 2 '14 at 12:47
0

Fetch your profiles.

$ force fetch -t Profile

Replace the contents of your Chatter Profiles (Chatter External User, Chatter Free User, etc.) to disable the Record Types.

<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
    <recordTypeVisibilities>
        <default>false</default>
        <recordType>My_Object__c.Bad</recordType>
        <visible>false</visible>
    </recordTypeVisibilities>
</Profile>

Deploy the profiles.

$ force push src/profiles/Chatter*
-2

This can be done by url hacking. You just need to go one more step ahead.

  1. Go to sysadmin profile.
  2. Scroll down to record type settings and click on the edit link for changing the record type of the object concerned. This will open the record type edit page for the object, for sysadmin profile.
  3. Now replace the id of sysadmin profile in the url with id of the profile you want to change; you have to do it in two places.
  4. This will take you to the page where you can remove the record type.
  • How does this answer provide information that is not already there in more detail on URL hacking than the accepted answer? – Dave Humm Aug 22 '17 at 14:42

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