I am moving an Apex Trigger from Sandbox to Production and this is the error I am getting in the Apex Test:
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: 0120v000000TPT9AAO: [RecordTypeId] Stack Trace: Class.RequireRejectionCommentTest.generateAndSubmitObject: line 166, column 1 Class.RequireRejectionCommentTest.testApprovalWithoutComment: line 49, column 1
It's telling me as the Salesforce Admin I do not have access to this record but I do I checked and I have access to these record types.
This is the code right here:
testBatchIS.add(new Case(Hours__c=15.12,RecordTypeId='0120v000000TPT9AAO',AccountId='0017000001XpguKAAR', Status='New',Concession_Category__c='Scope Change', Explanation_for_Business_Reason_Choice__c='stuff'));
I think it might have to do with the way I reference the Record Type as an ID.
instead of referencing it as RecordTypeID how would I reference it by the RecordTypeName instead?