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
ahsensahsens 

Cross Reference ID RecordTypeId not Valid

I have created a custom Object "A" in sales force which has 10 record types. i have created two more custom objects "B" and "C". I have created a Master Detail relation ship in B & C with A. so A is the Parent of B & C. now i have created an S-Control which clone A and its related objects B & C. when i run the S-Control I select all the fields of A, except the sales force standard fields which sales force uses internally, and then i create a new Object of type A and set all of new Objects fields with the values extracted initially. Now when i run the Create query i get an exception that Cross Reference Id not Valid, The RecordTypeId is not valid for the current user profile. I have checked the user profile and included all the 10 record types in Object A in the Profile so the user with this profile can create records of A by selecting one of the RecordType ID.

 

Now i don't understand why this error is coming. I am using sales force API 8.0 in my S-controls. I have also made the exact thing in Sandbox environment and tested it there. This “create” call works correctly there and there isn't any such error. Can any one tell me what I might be doing wrong?

 

i have written a separate s-control which just create a new record of A with some junk values but I have written and developed this with the old API Ajaxbeta3.3 and API 7.0 I had run the create query successfully and no error for record Type Id ever occurred.

 

is there some different way to set the RecordTypeId in the New API 8.0 and later?

 

A quick response will be appreciated.

benjasikbenjasik
can you set the record type via the UI to the same value you want in the api?  Typically this means the record type you're specifying isn't valid
ahsensahsens
this issue has been resolved. actually the problem was with the session. we have used the latest API and have also updated our code and every things seems to be working now.