Skip to main content
Nintex Community Menu Bar

Is there a way to hide the None option for a Picklist without making the picklist Required? I’ve been looking over the documentation for creating custom field renderers and am having trouble figuring out how to remove the None option from my picklist without making the picklist required.


I’m conditionally rendering a picklist based on whether or not the Logic__c field was defined on row creation. If it wasn’t defined on row creation, the Logic__c field doesn’t apply and I don’t render the field. Here’s my code currently (Logic__c is a Picklist field):


var params = arguments 0],<br>$ = skuid.$;
var field = arguments 0];<br>var row = field.row;<br>var value = arguments 1];

if(row.Logic__c !== undefined){<br>&nbsp; &nbsp; skuid.ui.getFieldRenderer(field.metadata.displaytype).edit( field, value );<br>}

I’d like to force it such that the None option is not selectable in Logic__c’s custom rendered picklist, but if I set my picklist to Required it causes problems for the rows that I intentionally create that have Logic__c undefined because on model save it wants Logic__c to always have a value.


Any help in understanding how to work with custom rendering picklists would be helpful. The documentation currently has me lost on trying to get this specific thing to work. Thanks!

Figured it out based on a reply lower in this forum post: https://community.skuid.com/t/how-do-i-render-custom-picklist-values

After rendering the picklist you basically look for an element in the picklist with a blank value and remove it

Code as follows:

var params = arguments[0],
$ = skuid.$;
var field = arguments[0];
var row = field.row;
var value = arguments[1];
if(row.Logic__c !== undefined){
skuid.ui.getFieldRenderer(field.metadata.displaytype).edit( field, value );
var select = field.element.find(‘select’);

if (select.length) {
// Remove unwanted entries
$.each(select.children(‘option’),function(){
if ($(this).val()===‘’){
$(this).remove();
}
});
}
}```