“INVALID_TYPE: record type doesn’t belong to” Salesforce Exception

“INVALID_TYPE: record type doesn’t belong to” Salesforce Exception

“INVALID_TYPE: record type doesn’t belong to” Salesforce Exception might be due to following:

1. If you are using e.force:createRecord, make sure the RecordTypeId attribute has the correct record type id value.
let createRecord = $A.get( “e.force:createRecord” );
createRecord.setParams( {
    “entityApiName”: “Account”, 
    “recordTypeId”: “XXXXXXXXXXXXXXXXXX”
} );
createRecord.fire();

 
2. It might be due to Browser Cache. So, try in Incognito Mode or clear Cookies and Cache and give a try.
SOQL to find the Object Type for Record Type Id:
SELECT Id, Name, DeveloperName, sObjectType
From RecordType
Where Id ='<RecordType Id>’

Leave a Reply