User's default record type value in picklist even though it doesn't match the filter

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I've got a create new account section of my page, with a NewBorrower model that loads a blank row by default. I've got a condition on the model for RecordType.Name contains "Borrower", of which there are several. On the Record Type field in the field editor I have a filter for RecordType.Name contains Borrower. However, the default record type for my profile is "Account", so when I load the page, the Record Type picklist shows Account, and must be changed every time.

Is there a way to override the user profile's default object record type some how to not show that value in a record type picklist?
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Have you tried to create a reference field filter on the Record Type field itself.   Rather than trying to use a model condition?   Ive gotten that to work just fine. 

Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Did this work on the field when set to picklist?
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
Yeah, I've got it there as well, not working. I had Name as the filter field, just tried DeveloperName like you have and same thing.

I've had this problem all over place, like for other objects the default record type for the user profile was Master, and that really caused problems. I fixed it before just changing the profile's default record type, which I can do again, but I just wish there was a better way, I'm sure there will be a case where I really can't change the profile's default object record type. Thanks


Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Is it not impossible to have a profile use the Master record type as well as other customer types?  
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
with skuid, the impossible is possible
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
HA! 
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I believe that the Filter doesn't account for the initial value/values whether picklist or otherwise. In other words, the picklist does a query to get the values, since record types are in another object. This query doesn't take into account the filter value.

You'll have to use a Condition to set it's value. To do so properly, at least the way I know how, is to use the RecordType object in a model and then use this to set the Condition in your Borrower model.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
A little tweaking - in my use case we have five different account Record Types with the word Borrower in them and I want them all to show up.

I followed your first steps:

NewBorrowerRecordType model with a condition of ID = one of the Borrower record type IDs

existing NewBorrower model (doesn't load data on page load, loads one empty row) modified to include a condition of RecordTypeID = Id from NewBorrowerRecordType model

This makes the value in the Record Type picklist field default to the Borrower Record Type

THEN - on my field in the field editor, the filter is the same as it was - RecordType.Name contains "Borrower"

Now, it starts out with Borrower, but shows all the other Borrower record Types (Borrower Entity, etc.) and doesn't show the User's default record type. 

I tried to have the RecordType model load 5 rows, and have ID in multiple values, then have the NewBorrower model have a RecordType IN the values from the RecordType model, and that doesn't work. It HAS to be = one single RecordType ID, but then the field filter can include all of the RecordTypes available or narrow them down.



Thanks!!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
So this works with the default from the model and the additional desired values coming the filter into  the picklist?
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
exact