condition on ui-only formula field not working.

Anyone have an explanation for this?

Here’s a video with the full story:

Hey Matt -

Lots of models involved and was a little bit difficult to follow the relationships/sequence in the video. That said, I think what you are trying to do is apply a Model Condition that is based on a UI Only field, correct?

If so, then I believe this is not supported. The reason for this is that Skuid issues a SOQL statement to retrieve the data. Since UI Only fields are client-side only, it cannot include the UI Only field in the SOQL.

Below is a sample page that demonstrates what I think you are trying to do. If you inspect the skuid.$M(‘Account’).soql you’ll see the condition “HasParent” isn’t even applied. I tried to get cute and set the filter search on the table to “Client” hoping that it would use the HasParent condition but that didn’t work either.

Short story - if I’m understanding your scenario correctly, the issue here is not that the records aren’t filtering but rather that the UI Only field should not be selectable as a field on the Model condition since Skuid is going to have to ignore it anyway. I would consider that part a bug.

If I’m misunderstanding your scenario, just lemme know :slight_smile:

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">
        <model id="Account" limit="100" query="true" createrowifnonefound="false" adapter="salesforce" service="salesforce" sobject="Account" type="">
                <field id="Name"/>
                <field id="CreatedDate"/>
                <field id="ParentId"/>
                <field id="Parent&#46;Name"/>
                <field id="HasParent" uionly="true" displaytype="FORMULA" label="Has Parent" readonly="true" returntype="BOOLEAN">
                    <formula>{{ParentId}} != ""</formula>
                <condition type="fieldvalue" value="true" enclosevalueinquotes="false" field="HasParent" state="filterableoff" inactive="true" name="HasParent" operator="="/>
        <pagetitle model="Account" uniqueid="sk-385123-74">
                <action type="savecancel"/>
        <skootable showconditions="true" showsavecancel="false" searchmethod="client" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" mode="read" uniqueid="sk-385123-75" emptysearchbehavior="query">
                <field id="Name" allowordering="true"/>
                <field id="CreatedDate" allowordering="true"/>
                <field id="ParentId" valuehalign="" type=""/>
                <field id="HasParent" type="" valuehalign=""/>
                <action type="edit"/>
                <action type="delete"/>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
                <view type="standard"/>
                <filter type="toggle" filteroffoptionlabel="New Filter" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="manual" labelmode="auto" label="Has Parent Only">
                        <effect action="set" value="true" condition="HasParent"/>
        <styleitem type="background" bgtype="none"/>

TL DR  (as in Too Late…)  But Barry is right.  UI ONly fields cannot be used in model conditions because the model condition is affecting the SOQL and how the database is being requeried.  The UI only field is not in the database…   Sorry. 

Thanks for confirming Rob.

Matt - Assuming this is your use case, I’d recommend filing a new community issue around the fact that UI Only fields are “selectable” in Model Conditions and they should not be since they are ignored.  Hopefully avoid others from running in to the same questions and saving them some cycles.