New Record - Filter Available Record Types?

I built a pop-up window that allows a user to create a case.  There is a picklist of the available record types for the user to choose from to determine the department they want to create a case for.  I want to filter the list of available case record types in the picklist, whats the best way to do that with Skuid?


Update: I am working with the contents of this post:

I created a simple snippet but it is not rendering a picklist, it creates a field that requires I type in the name:

var field = arguments[0], value = skuid.utils.decodeHTML(arguments[1]); if (field.mode == 'edit') { var picklistEntries = field.metadata.picklistEntries; picklistEntries.push( { value: 'Tech Support', label: 'Tech Support', defaultValue: true, active: true }, { value: 'Accounting', label: 'Accounting', defaultValue: false, active: true } ); } skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value);
  1. What do I need to do to make the page render a picklist rather than a text field?
    2) Since this is the RecordTypeID field do I need to pass in the RecordTypeID?  Or should I use the RecordType.Name field?

Check out this tutorial: you need “skuid.ui.fieldRenderers[‘PICKLIST’]field.mode;”

I may be interpreting your question incorrectly, but it looks like you may be able to get your picklist values without using a snippet.

If all you’re trying to do is simply render your field as a picklist and limit the available picklist options, you can render your record type field as Picklist, then create a lookup filter on the record type field is not in the list of multiple specified values, and then list the names of the record types you don’t want to include. 

Also, regarding part (2) of your question, RecordTypeId is a reference to the RecordType object. All record types in Salesforce fall into the RecordType object, and each has a field SobjectType which contains the name of Sobject to which the particular record type applies. So, like other reference objects in Skuid, the field uses an id to get another object, but it allows the user to look up an object by typing in its name, and it displays the field as the object’s name.


Thanks for your direction.  That helped!


That is where I went first but it doesn’t behave as I expected.  It wasn’t removing the items I listed using the method you suggested and I couldn’t determine why.  That’s what drove me to use a Snippet.  Moshe’s suggestion helped and I think I am going to proceed with that route for now.  I would prefer your route to avoid managing code.  

A couple more tips (for future reference):

1) Make sure you’re using the Name field on record type, not the DeveloperName.
2) You can also create a model on RecordType, with a condition that the SobjectType is “Case”, and another condition that excludes the Names of particular record types. Then, your lookup filter would bring in only the values from the RecordType model.

I’ve always had to choose the Name field specifically off the Record Type reference when doing Record Type filters. e.g. RecordTypeId.Name = ‘Contacts’; if I try and do RecordTypeId = ‘Contacts’ it doesn’t work - it’s looking for the actual RecordTypeId.