Error "Record Type ID: this ID value isn't valid for the user" when creating a new record

  • 1
  • Problem
  • Updated 1 year ago
  • Solved
I have created a popup to capture a new record.  In the Model, I have a Condition to tie the record to a specific record type ID because there are multiple record types in this object.  When I create the new record, the correct record type ID shows on my form.  However when I attempt to save it I am getting an error message:  "Record Type ID: this ID value isn't valid for the user".  I have verified that the user profile has access to this record type.  Any ideas why I'm getting this error?
Photo of Paul Ginther

Paul Ginther

  • 896 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
Check that the users profile has the record type assigned to them.
Photo of Paul Ginther

Paul Ginther

  • 896 Points 500 badge 2x thumb
Hey Pat.  Thanks for the response.  I'm testing with the System Admin profile and have verified that it has access to that record type.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
You could try other record type Id's and see if it is an issue with any or just that one...
Photo of Paul Ginther

Paul Ginther

  • 896 Points 500 badge 2x thumb
I tried changing the criteria from the ID to the ID Name and that appears to be working.  Not sure what the difference is.  Thanks for your input Raymond!
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 10,978 Points 10k badge 2x thumb
It sounds like you've found the root of your problem, but I just wanted to add that it can be tricky to rely on record type ID#s in uses like this if your pages are moved from a sandbox to a production org, because those can change from org to org. 
Photo of Paul Ginther

Paul Ginther

  • 896 Points 500 badge 2x thumb
Thanks for the heads up on that Mark.  Is there another alternative you would suggest?  I need the new records to always be a specific record type and I only want to display records of that type in my table.
Photo of Paul Ginther

Paul Ginther

  • 896 Points 500 badge 2x thumb
Pat - here is the XML for that Model:
        </model>
        <model type="" id="RiskAssessmentExit" limit="20" query="true" createrowifnonefound="true" sobject="Risk_Assessment_Review__c" orderby="CreatedDate DESC" datasource="salesforce" doclone="">
            <fields>
                <field id="Exit_Answer_1__c"/>
                <field id="Exit_Answer_2__c"/>
                <field id="Exit_Answer_3__c"/>
                <field id="Exit_Answer_4__c"/>
                <field id="Exit_Answer_5__c"/>
                <field id="Exit_Answer_6__c"/>
                <field id="Exit_Answer_7__c"/>
                <field id="Exit_Question_1A__c"/>
                <field id="Exit_Question_1B__c"/>
                <field id="Exit_Question_1C__c"/>
                <field id="Exit_Question_1D__c"/>
                <field id="Exit_Question_2__c"/>
                <field id="Exit_Question_4__c"/>
                <field id="Exit_Question_3__c"/>
                <field id="Exit_Question_5__c"/>
                <field id="Exit_Question_5A__c"/>
                <field id="Exit_Question_5B__c"/>
                <field id="Exit_Question_6__c"/>
                <field id="Exit_Question_7__c"/>
                <field id="Name"/>
                <field id="Date_Review_Submitted__c"/>
                <field id="Date_Review_Approved__c"/>
                <field id="RecordTypeId"/>
                <field id="RecordType.Name"/>
                <field id="Restricted_Client_Information__c"/>
                <field id="Restricted_Client_Information__r.Name"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="012G00000010tnm" field="RecordTypeId" operator="=" mergefield="Id" novaluebehavior="noquery" enclosevalueinquotes="true" state=""/>
                <condition type="modelmerge" value="" field="Restricted_Client_Information__c" operator="=" model="RCI" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
            </conditions>
            <actions/>
            <groupby method="simple"/>
        </model>
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 10,978 Points 10k badge 2x thumb
When you're filtering existing records based on their record type, the record type name is the best option. But given what Pat says above, creating a new record might just need that particular ID#. Alternatively, there might be a way to use an intermediate model to pull in your record types by name and ID#, and then grab the correct ID# from there and using it when creating a new row. This is just a rough idea. Depending on how many places this happens in your pages, it may be easier to just make a note to double check the record type ID#s as part of your migration process between orgs. 
Photo of Paul Ginther

Paul Ginther

  • 896 Points 500 badge 2x thumb
Thanks Mark.   That step was actually on my deployment check list.  I always do that when I am hard coding an ID value.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Before your popup open, you probably want to add a "create new row" action.
Photo of Paul Ginther

Paul Ginther

  • 896 Points 500 badge 2x thumb
Thanks Raymond!  That's what I needed.  Thank you all so much for your assistance.  I was just thrown into an existing Skuid deployment and tasked with making some changes.  I don't have a lot of experience working with this UI so I really appreciate you generously sharing your knowledge!