How do I render custom picklist values?

One solution to this is, which doesn’t require a custom renderer, is to add multiple RecordTypes to your Salesforce object. Then, different RecordTypes can be assigned to different Profiles, and each RecordType can have its own set of Picklist Values for each of your Picklist / Multi-select Picklist Fields. This functionality is supported by Skuid in the Spring 13 release. However, this strategy involves added setup effort, and adding RecordTypes is not always an ideal / desired solution, particularly if there’s only one picklist that you want to have different values for. Also, you’ll have to make sure that the correct RecordType is chosen on a given record in order for this functionality to take effect — either by having a Condition on your model explicitly like RecordTypeId = ‘School’, or whatever the API name of the RecordType is, or by adding the RecordTypeId field to your Field Editor or Table and requesting the user to select the desired RecordType. All that being said… Here’s how you could do it with a custom Field Renderer instead :slight_smile: If you want to do conditional picklist value adding based on Profile Name, instead of Profile Id, then you’ll need to request the Running User’s Profile information in a separate model on your page, e.g. a ‘RunningUser’ model.

var field = arguments[0], value = arguments[1]; // Get the Running User's Profile Name from a 'RunningUser' model: var userModel = skuid.model.getModel('RunningUser'), user = userModel && userModel.getFirstRow(), profileName = user && userModel.getFieldValue(user,'Profile.Name',true), isAdmin = (profileName == 'System Administrator'); // // Bonus points FIRST :) // // Prevent non-Admins from making any edits // if the current status is 'Approved'. // if ((value === 'Approved') && !isAdmin) { field.editable = false; field.mode = 'read'; } if (field.mode == 'edit') { var picklistEntries = field.metadata.picklistEntries; if (isAdmin) { // add picklist values 'working' and 'submitted' picklistEntries.push( { value: 'Working', label: 'Working', defaultValue: false, active: true }, { value: 'Submitted', label: 'Submitted', defaultValue: false, active: true } ); } else if (profileName == 'Sales Manager') { picklistEntries.push( { value: 'In Review', label: 'In Review', defaultValue: false, active: true } ); } } // Run the standard picklist renderer for the given mode skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value);