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
AbAb 

ERROR System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Record Type ID: this ID value isn't valid for the user: 012b0000000TmUJAA0: [RecordTypeId]

Hello,

I am system admin , when i try to deploy something, i get below errors

A_test.mytest System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Record Type ID: this ID value isn't valid for the user: 012b0000000TmUJAA0: [RecordTypeId] 
A__test.mytest: line 18, column 1

B_delete_test.mytest1 System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Record Type ID: this ID value isn't valid for the user: 012b0000000TmUJAA0: [RecordTypeId] Class.B_delete_test.mytest1: line 17, column 1

I wonder what can be exact reason ?
Best Answer chosen by Ab
Medhya MahajanMedhya Mahajan
Hi Sandrine, 

This might be happening because the user does not have access to a particular record type. 

You need to go to profile of the user and give the record type access.

Let me know if this helps.

Regards
Medhya Mahajan

 

All Answers

Medhya MahajanMedhya Mahajan
Hi Sandrine, 

This might be happening because the user does not have access to a particular record type. 

You need to go to profile of the user and give the record type access.

Let me know if this helps.

Regards
Medhya Mahajan

 
This was selected as the best answer
Avinash BarolaAvinash Barola
Hi Sandrine, 
This link can hep.
https://developer.salesforce.com/forums/?id=906F00000009FC5IAM