Model with a subquery condition and a subcondition migrated incorrectly to version 11.2.9

  • 1
  • Problem
  • Updated 4 weeks ago
We are seeing this in 2- to 3-year old pages, just noted after migration to version 11.2.9.

The Subcondition Logic value should be something like "1 OR 2" - not the subcondition itself. This appears to be an error in the migration from, I think, 11.1.4.

If the model is populated at page-load, the subquery is handled as desired. However, if the query is deferred and run by a javascript model.updateData() call, the subcondition is not included in the SOQL as shown by skuid.$M.("MyModel").soql).
Photo of Mike Dwyer

Mike Dwyer

  • 3,390 Points 3k badge 2x thumb

Posted 4 weeks ago

  • 1
Photo of Mike Dwyer

Mike Dwyer

  • 3,390 Points 3k badge 2x thumb
Here's a sample page, with console messages displaying the change to the SOQL:

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
        <model id="Users" limit="20" query="false" createrowifnonefound="false" datasource="salesforce" sobject="User">
                <field id="Name"/>
                <field id="LastLoginDate"/>
                <condition type="join" value="" field="Id" operator="in" enclosevalueinquotes="true" joinobject="ApexClass" joinfield="CreatedById" fieldtargetobjects="User" logic="CreatedDate &lt; LAST_N_YEARS:3"/>
                        <action type="custom" snippet="onRequery"/>
        <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="Users" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-28ss-1173">
                <field id="Name" hideable="true" uniqueid="fi-28s--1212"/>
                <field id="LastLoginDate" hideable="true" uniqueid="fi-28s--1213"/>
                <action type="edit"/>
                <action type="delete"/>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
                <view type="standard"/>
            <actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
                <action type="multi" icon="sk-icon-case" label="Query Users">
                        <action type="requeryModel" model="Users" behavior="standard"/>
            <jsitem location="inline" name="onPageLoad" cachelocation="false" url="">(function(skuid){
var $ = skuid.$;
        console.log("Query on page load:")
            <jsitem location="inlinesnippet" name="onRequery" cachelocation="false">console.log("on re-query:")
        <actionsequences uniqueid="sk-28s--1206"/>
        <styleitem type="background" bgtype="none"/>

You may need to play with the subcondition itself. The subquery as I defined it will list our earliest Apex Class authors. When the SOQL "breaks," it lists all our Apex Class authors. But you will see the SOQL change regardless of the user records actually retrieved, or not.