The action framework Update field on row with picklist fields is limited to predefined values

  • 1
  • Problem
  • Updated 4 months ago
We have a UI-Only picklist providing a subset - actually a different set - of values to a lengthy list specified in the database.

The skuid page needs to
  • copy the value from the database field to the ui-only field on query,
  • allow edits to the ui-only field, and then
  • copy the ui-only value to the database field on save.
We used to do this with merge syntax on the Update-field-on-row action. Now, we have to override the picklist validation by going to XML.

An example, set up a little differently:

The sObject includes Color__c, defined with values "Red", "Blue", "Green" and not restricted to these values.

The model includes a UI-Only field, UI_Color, with values "Yellow" and "Orange."

The table displays Color__c and has a custom Edit row action. The action updates UI_Color to {{Color__c}} (in the XML. We cannot do this in the composer!) and then opens a popup.

The popup displays UI_Color in a field editor, allowing the user to select either Yellow or Orange.

The custom Save button on the popup updates Color__c to {{UI_Color}} -- also in the XML because it can't be done in the composer.

My thinking is that recent releases in v11.2 have added picklist field validation but have now tightened down the restriction to not allow for picklist fields that do not require values to be in the database list of values. We need an option to allow entry of values that either are not defined in the database field or are copied from other fields in the model - or even from other models - as used to be possible.

The overly restrictive version is v11.2.22.

Photo of Mike Dwyer

Mike Dwyer, Champion

  • 4,716 Points 4k badge 2x thumb

Posted 4 months ago

  • 1
Photo of Conlan O'Rourke

Conlan O'Rourke

  • 4,468 Points 4k badge 2x thumb
I have noticed this as would be very nice to have the option to select one of the pre-defined picklist values or the option to use a result from a formula where merge syntax can be used.
Photo of Mike Dwyer

Mike Dwyer, Champion

  • 4,716 Points 4k badge 2x thumb
Ironically, it is possible to fool the composer by entering the desired "invalid" value before selecting the picklist field. The Value field turns out to be sticky enough to override the validation.
Photo of Luzie Baumgart

Luzie Baumgart, Official Rep

  • 3,542 Points 3k badge 2x thumb
Hi Mike, I'm not sure if we completely understand your use case. Have you tried the option to override the field metadata at the model field? If yes, but it doesn't meet your requirements, could you please let us know, why not? Furthermore, would be great if you could share a simple repro page XML with us here in the post.
Photo of Mike Dwyer

Mike Dwyer, Champion

  • 4,716 Points 4k badge 2x thumb
It will take me awhile to put a repro page together, especially since we only use custom objects. I may not be able to try your suggestion for awhile either. I recall that it was considered, but don't recall if we encountered a limitation. I do have the workaround that I mentioned previously, as well as the ability to edit the XML directly, so there is no urgency. 

Our expectation is that Skuid will provide the ability to work with the Salesforce setup/admin options, where a picklist field (optionally) does not restrict the picklist to the values defined in the value set.

Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 2,866 Points 2k badge 2x thumb
Hi Luiz, are you saying to that to assign single specified value to a picklist field we need to edit XML or use the Stickiness that Mike mentions? ditto conlan- Ironically, v1 seems to work fine but v2 doesn't.
Following is quick demo page: The value was placed using sticky Value approach but obviously there should be numerous other options (standards).

<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
<model id="testPickListField" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
<field id="Amount"/>
<field id="StageName"/>
<field id="Name"/>
<skuid__table model="testPickListField" uniqueid="sk-epK-65" mode="read" title="Test Set Single Value">
<field id="Name" uniqueid="sk-epV-77"/>
<field id="Amount" uniqueid="sk-epV-79"/>
<field id="StageName" uniqueid="sk-epV-81"/>
<filtering enableSearch="false" instantSearch="false"/>
<action type="multi" label="Run multiple actions">
<action type="updateRow" fieldmodel="testPickListField" affectedrows="context">
<update valuesource="fieldvalue" field="StageName" enclosevalueinquotes="true" value="Won"/>
<actionsequences uniqueid="sk-ep2-60"/>
<styleitem type="background" bgtype="none"/>