When using the “Query Models” action, if the Query Behavior is marked to “Get More - Merge in new records” an Uncaught TypeError is encountered.
Steps to reproduce:
- Create page using XML below
- Click on “error icon” row action - This uses Query Models
Actual Result
Uncaught Type Error
Expected Result
Model is re-queried and drawer displays
Notes:
- If Query Model is used (the green checkmark row action), the problem does not occur.
- When Query Models is used the problem occurs regardless of how many models are selected.
- It appears in the case of Query Model, “get more data” is called from the model itself where as in Query Models, “get more data” is attempted to be called from skuid.model. Changing skuid.modelfuncName to “curModelfuncName” should do the trick
Sample Page
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account"> <models>
<model id="Account" limit="100" query="true" createrowifnonefound="false" sobject="Account">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="Contact" limit="" query="false" createrowifnonefound="false" sobject="Contact" doclone="" type="">
<fields>
<field id="Id"/>
<field id="Name"/>
<field id="AccountId"/>
<field id="Account.Name"/>
</fields>
<conditions>
<condition type="modelmerge" value="" field="AccountId" operator="in" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Account">
<maintitle>
<template>{{Model.labelPlural}}</template>
</maintitle>
<subtitle>
<template>Home</template>
</subtitle>
<actions/>
</pagetitle>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="false" model="Account" mode="readonly">
<fields>
<field id="Name" allowordering="true"/>
<field id="CreatedDate" allowordering="true"/>
</fields>
<rowactions>
<action type="multi" label="Query Model" icon="sk-icon-mark-completed">
<drawer title="Drawer Area" width="800" closehandle="true">
<components/>
</drawer>
<actions>
<action type="requeryModel" model="Contact" behavior="loadmore">
<models>
<model>Contact</model>
</models>
</action>
<action type="drawer">
<drawer title="Drawer Area" width="800" closehandle="true">
<components>
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Contact" buttonposition="" mode="read">
<fields>
<field id="Id"/>
<field id="Name"/>
</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"/>
</conditions>
</skootable>
</components>
</drawer>
</action>
</actions>
</action>
<action type="multi" label="Query Models" icon="sk-icon-error">
<drawer title="Drawer Area" width="800" closehandle="true">
<components/>
</drawer>
<actions>
<action type="requeryModels" behavior="loadmore">
<models>
<model>Contact</model>
</models>
</action>
<action type="drawer">
<drawer title="Drawer Area" width="800" closehandle="true">
<components>
<skootable showconditions="true" showsavecancel="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Contact" buttonposition="" mode="read">
<fields>
<field id="Id"/>
<field id="Name"/>
</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"/>
</conditions>
</skootable>
</components>
</drawer>
</action>
</actions>
</action>
</rowactions>
<massactions usefirstitemasdefault="true"/>
<views>
<view type="standard"/>
</views>
<searchfields/>
</skootable>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>