This issue relates to this thread: https://community.skuid.com/t/ui-only-picklist-options-that-are-values-from-a-field-on-an…
I was able to get John’s recommended code working on the latest version of Skuid for Salesforce, but when I try to implement on Skuid Platform it doesn’t work. I’m thinking there might be a bug with how Skuid Platform is applying the model conditions via javascript. Basically nothing happens when the javascript is run and the conditions should have been applied.
Here is sample code for Skuid Platform (change the datasource) to reproduce the issue:
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true"> <models> <model id="Filter" query="false" createrowifnonefound="false" datasource="ENTER_SALESFORCE_DATASOURCE" processonclient="true" type="" sobject="Account" limit="1" uniqueid="sk-pNJKb-264"> <fields> <field id="Id" accessible="true" createable="false" editable="false" filterable="true" groupable="true" sortable="true" displaytype="ID" label="Account ID"/> <field id="Industry" accessible="true" createable="true" editable="true" filterable="true" groupable="true" sortable="true" length="40" displaytype="PICKLIST" label="Industry"/> </fields> <conditions> <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Industry" state="filterableoff" inactive="true" name="Industry"/> </conditions> <actions> <action> <actions> <action type="blockUI" message="Applying..."/> <action type="custom"> <onerroractions> <action type="blockUI" message="There was an error" timeout="3000"/> </onerroractions> </action> <action type="requeryModel" model="Account" behavior="standard"> <onerroractions> <action type="blockUI" message="There was an error" timeout="3000"/> </onerroractions> </action> <action type="unblockUI"/> </actions> <events> <event>models.loaded</event> </events> </action> </actions> </model> <model id="Account" query="true" createrowifnonefound="false" datasource="Alignly_SFDC_DEV" processonclient="true" type="" sobject="Account" limit="50" uniqueid="sk-pNJKb-264"> <fields> <field id="Id" accessible="true" createable="false" editable="false" filterable="true" groupable="true" sortable="true" displaytype="ID" label="Account ID"/> <field id="Industry" accessible="true" createable="true" editable="true" filterable="true" groupable="true" sortable="true" length="40" displaytype="PICKLIST" label="Industry"/> <field id="Name" accessible="true" createable="true" editable="true" filterable="true" groupable="true" namefield="true" required="true" sortable="true" length="255" displaytype="STRING" label="Account Name"/> </fields> <conditions> <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Industry" state="filterableoff" inactive="true" name="Industry"/> </conditions> <actions/> </model> </models> <components> <filterset searchmethod="server" searchbox="true" uniqueid="sk-pMHJn-162" model="Filter" position="right" emptysearchbehavior="query"> <filters> <filter type="select" filteroffoptionlabel="All Industries" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="manual" filtermethod="server" labelmode="manual" condition="Industry" label="Industry"> <sources> <source type="metadata" effectsbehavior="justdefault"/> </sources> </filter> </filters> <searchfields/> </filterset> <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="50" alwaysresetpagination="false" createrecords="false" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-pMI80-166" model="Account"> <fields> <field id="Name" hideable="true" uniqueid="fi-pNdYe-454" valuehalign="" type=""/> <field id="Industry" hideable="true" uniqueid="fi-pNdy5-466" valuehalign="" type=""/> </fields> <rowactions/> <massactions usefirstitemasdefault="true"/> <views> <view type="standard"/> </views> <renderconditions logictype="and"/> <searchfields/> </skootable> </components> <resources> <labels/> <javascript> <jsitem location="inlinesnippet" name="crossFilter" cachelocation="false" url="">var $ = skuid.$, Filter_Model = skuid.$M('Filter'); Account_Model = skuid.$M('Account'); $.each(Filter_Model.conditions, function(i,condition){ var priConditionName = condition.name, basicCondition1 = Account_Model.getConditionByName(priConditionName); if(condition.inactive) { Account_Model.deactivateCondition(basicCondition1); } else { Account_Model.activateCondition(basicCondition1); Account_Model.setCondition(basicCondition1,condition.value); } });</jsitem> </javascript> <css/> <actionsequences uniqueid="sk-pNJKb-263"/> </resources> <styles> <styleitem type="background" bgtype="none"/> </styles> </skuidpage>