"__r" field of condition field not being set when creating new row and model marked "process client side"

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
With a model marked to process client side, when a new row is created based on a condition applied against a "reference" field, the "__r" field of the model is not being set.  This only seems to occur when the model that the new row is being created in has no rows that currently meet the condition.  

Notes
1) I recall a similar situation to this a while back where if the target model was empty, the "__r" wasn't being set properly.  I scoured the community but couldn't find that issue/discussion.  I recall that scenario being addressed however.
2) If the model is marked to NOT process client side, the problem does not occur

Steps to reproduce
1) Create page using XML below
2) Preview page picking an account that has at least one contact
3) Expand the account drawer to see the contacts
4) Click "Add New"
5) Inspect skuid.$M('Contact').data[0]

Expected Behavior = Actual Behavior
Model row contains "Account__r" and all Account fields defined on Model

6) Preview page picking an account that has NO contacts
7) Expand the account drawer to see the contacts
8) Click "Add New"
9) Inspect skuid.$M('Contact').data[0]

Expected Behavior
Model row contains "Account__r" and all Account fields defined on Model

Actual Behavior
Model row does NOT contain Account__r property

Sample Page XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account" personalizationmode="server">   <models>
      <model id="Account" limit="" query="true" createrowifnonefound="false" sobject="Account" type="" adapter="" doclone="" processonclient="true">
         <fields>
            <field id="Name"/>
            <field id="Id"/>
            <field id="CreatedById"/>
            <field id="CreatedBy.Name"/>
            <field id="CreatedDate"/>
         </fields>
         <conditions>
            <condition type="param" value="id" field="Id" operator="=" enclosevalueinquotes="true" novaluebehavior="noquery"/>
         </conditions>
         <actions/>
      </model>
      <model id="Contact" limit="" query="false" createrowifnonefound="false" adapter="" type="" sobject="Contact" doclone="" processonclient="true">
         <fields>
            <field id="FirstName"/>
            <field id="Name"/>
            <field id="LastName"/>
            <field id="AccountId"/>
            <field id="Account.Name"/>
            <field id="Account.CreatedById"/>
            <field id="Account.CreatedBy.Name"/>
            <field id="Account.CreatedDate"/>
         </fields>
         <conditions>
            <condition type="fieldvalue" value="" field="AccountId" operator="=" mergefield="Id" novaluebehavior="noquery" state="filterableoff" inactive="true" enclosevalueinquotes="true" name="AccountId"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" buttonposition="" mode="read" uniqueid="sk-2Pc4hF-116" emptysearchbehavior="query">
         <fields>
            <field id="Name"/>
         </fields>
         <rowactions>
            <action type="multi" label="View Details" icon="sk-icon-magic">
               <renderconditions logictype="and"/>
               <actions>
                  <action type="drawer">
                     <drawer title="Drawer Area" width="90%" closehandle="true">
                        <components>
                           <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="true" model="Contact" buttonposition="" mode="edit" uniqueid="sk-vf_Az-142" emptysearchbehavior="query">
                              <fields>
                                 <field id="FirstName"/>
                                 <field id="LastName"/>
                              </fields>
                              <rowactions>
                                 <action type="edit"/>
                                 <action type="delete"/>
                              </rowactions>
                              <massactions usefirstitemasdefault="true">
                                 <action type="massupdate"/>
                                 <action type="massdelete"/>
                              </massactions>
                              <views>
                                 <view type="standard"/>
                              </views>
                              <conditions>
                                 <condition type="contextrow" field="AccountId" mergefield="Id" operator="="/>
                              </conditions>
                              <actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
                                 <action type="multi" label="Add New" icon="sk-icon-magic">
                                    <actions>
                                       <action type="createRow" model="Contact" appendorprepend="prepend" defaultmodefornewitems="edit"/>
                                    </actions>
                                 </action>
                              </actions>
                              <searchfields/>
                           </skootable>
                        </components>
                        <beforeload>
                           <action type="setCondition" model="Contact" condition="AccountId" value="{{Id}}"/>
                           <action type="requeryModels" behavior="loadmore">
                              <models>
                                 <model>Contact</model>
                              </models>
                           </action>
                        </beforeload>
                     </drawer>
                  </action>
               </actions>
            </action>
         </rowactions>
         <massactions usefirstitemasdefault="true"/>
         <views>
            <view type="standard"/>
         </views>
         <searchfields/>
      </skootable>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Thanks Barry - We are looking into this (in addition to all the others....)
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Thanks Rob!
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Hi Barry,

I found the underlying cause of this issue, and it may fix some others as well. I'll let you know when we have a fix.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Thanks Ben!
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
This issue has been resolved in Banzai Update 8.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Tested and confirmed as of Update 8 (7.36).  Thank you!