As described in this related issue:
https://community.skuid.com/t/checkbox-ui-only-field-tolowercase-exception-on-cancel-c…
When using updateRow and inadvertently setting a Boolean field with an undefined value the following exception and stack trace occurs:
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined(…)o @ skuid__SkuidJS:27(anonymous function) @ skuid__SkuidJS:28o.extend.each @ skuid__JQuery:2(anonymous function) @ skuid__SkuidJS:28o.extend.each @ skuid__JQuery:2W.updateRows @ skuid__SkuidJS:28W.updateRow @ skuid__SkuidJS:28(anonymous function) @ VM2429:2InjectedScript._evaluateOn @ VM2423:875InjectedScript._evaluateAndWrap @ VM2423:808InjectedScript.evaluate @ VM2423:664
The issue occurs in the latest Banzai 7.24 but is handled without error in the only previous version of Skuid I have available to me 6.8.19. The following page xml and javascript should hopefully replicate the exception for diagnosis.
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" showheader="false"> <models> <model id="contacts" limit="10" query="true" createrowifnonefound="false" adapter="" type="" sobject="Contact"> <fields> <field id="HasOptedOutOfEmail"/> <field id="FirstName"/> <field id="DoNotCall"/> </fields> <conditions/> <actions/> </model> </models> <components> <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="false" model="contacts" buttonposition="" mode="edit" uniqueid="sk-dmIvC-91"> <fields> <field id="FirstName"/> <field id="HasOptedOutOfEmail" type="" valuehalign=""/> <field id="DoNotCall"/> </fields> <rowactions> <action type="edit"/> <action type="delete"/> </rowactions> <massactions usefirstitemasdefault="true"> <action type="massupdate"/> <action type="massdelete"/> </massactions> <views> <view type="standard"/> </views> </skootable> </components> <resources> <labels/> <javascript/> <css/> </resources> <styles> <styleitem type="background" bgtype="none"/> </styles> </skuidpage>
Run this code on the page above to trigger the exception:
skuid.$M("contacts").updateRow(skuid.$M("contacts").getFirstRow(),{"HasOptedOutOfEmail":undefined})
The easiest workaround I have is to check for undefined values and avoid setting them in the updateRow call.
Thanks to Barry and Ben for the support given in the related issue and hope that this is enough for a fix in the next release.