Assign picklist values from a global picklist to UI-only picklist

  • 2
  • Question
  • Updated 6 months ago
  • Answered
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?
Photo of Ashwat


  • 768 Points 500 badge 2x thumb

Posted 2 years ago

  • 2
Photo of Matthew Leahy

Matthew Leahy, Employee

  • 782 Points 500 badge 2x thumb
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.
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,602 Points 10k badge 2x thumb

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.



<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Task">
        <model id="Contact" limit="1" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Contact">
                <field id="Salutation"/>
        <model id="Task" limit="1" query="false" createrowifnonefound="true" datasource="salesforce" sobject="Task" type="">
                <field id="Subject"/>
                <field id="Picklist" uionly="true" displaytype="PICKLIST" label="Picklist" ogdisplaytype="TEXT" picklistsource="manual" snippet="getPicklist">
        <pagetitle model="Task" uniqueid="sk-1HSEX_-197">
                <template>New {{Model.label}}</template>
                <action type="savecancel" afterCancel="/{{Model.KeyPrefix}}/o" afterSave="/{{Id}}" rollbackonanyerror="true" uniqueid="sk-1HSEXz-195"/>
        <basicfieldeditor showsavecancel="false" showheader="true" model="Task" mode="edit" uniqueid="sk-1HSEYG-210">
                <column width="50%">
                        <section title="Basics">
                                <field id="Subject" uniqueid="sk-1HSEY6-205"/>
                <column width="50%">
                        <section title="Additional Info">
                                <field uniqueid="sk-1HSx4g-499" id="Picklist" valuehalign="" type="CUSTOM" snippet="getPicklist"/>
            <jsitem location="inlinesnippet" name="getPicklist" cachelocation="false">var params = arguments[0],
    value = arguments[1];
$ = skuid.$;



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

if (params.mode == 'edit') {
//    pick.push(con.fields[0].picklistEntries);

// Run the standard picklist renderer for the given mode
        <actionsequences uniqueid="sk-1HSIca-288"/>
        <styleitem type="background" bgtype="none"/>
Photo of Tim Shores

Tim Shores

  • 730 Points 500 badge 2x thumb
Works like a charm, Bill.
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 3,046 Points 3k badge 2x thumb
worked super smooth Bill. Thanks. Now just need to get it doing dependencies ;). Thanks again, seriously!