Skip to main content

Is there a way to assign picklist entries to a UI-only picklist field in a UI only model from a global picklist? In my case I just have a simple UI-only picklist field that needs to have all the 50 states as its picklist values. Instead of typing in all the 50 states, I was wondering if I could connect it to an already existing global picklist field. I see that it could be populated by “Rows in a model” or “Javascript snippet” but how do I put that to use here?

Hi Ashwat,

Salesforce does not give direct access to global picklist value sets. You can certainly use picklist fileds that use a global picklist value set, but I don’t think that’s what you’re after.


Ashwat,


Please give this a try. I pulled in a model (Contact) with a field (Salutation) that has a pick list that I want to use. I am creating a Task and I add a UI Only field that is of type Pick List. I add a custom field render and pull the pick list entries from the Salutation field and use them with the UI Only field.


Thanks,


Bill

























New {{Model.label}}


{{Model.labelPlural}}
































var params = arguments[0],
value = arguments[1];
$ = skuid.$;

console.log(params.metadata.picklistEntries);


var con=skuid.model.map().Contact;

console.log(‘Contact’);

console.log(con.fieldse0].picklistEntries);


// Get the Running User’s Profile Name from a ‘RunningUser’ model:


if (params.mode == ‘edit’) {

params.metadata.picklistEntries=con.fieldsi0].picklistEntries;

// pick.push(con.fieldsu0].picklistEntries);

}


// Run the standard picklist renderer for the given mode

skuid.ui.fieldRenderersfparams.metadata.displaytype]params.mode;








Works like a charm, Bill.


worked super smooth Bill. Thanks. Now just need to get it doing dependencies 😉. Thanks again, seriously!