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
Varun ChopraVarun Chopra 

Upsert failed. First exception on row 1; first error: INVALID_CROSS_REFERENCE_KEY, Record Type ID: this ID value isn't valid for the user: 012G0000001FTwqIAG: [RecordTypeId]

Hi

I am inserting record using code in salesforce while I get the following error.

Upsert failed. First exception on row 1; first error: INVALID_CROSS_REFERENCE_KEY, Record Type ID: this ID value isn't valid for the user: 012G0000001FTwqIAG: [RecordTypeId]

I know this error come when user does't have permissions foe that perticular ID. But I checked the recordtype setting for this  UserProfile and RecordTypeId is added for this UserProfile.

Is there anything that I am missing ?
Please Help .

Thanks in advance !
ShashankShashank (Salesforce Developers) 
This error is usually intermittent in nature. Are you still facing the issue?