Skip to main content

We are testing Brooklyn 10.x in a sandbox and have run into a problem that is causing a lot of our pages with custom javascript to fail (which is most of our pages.)


Within the javascript, we query a field on a model and then take action based on that field having a value or not. The fields on the object are strings, and:


if field is null, do Action 1.

if field is not null, do Action 2.


This all worked fine, but now the string fiend off the model is coming through as undefined instead of null or “”. So all our If conditions are failing to execute.


I’ve build a repro page off the contact object using a native string field that is probably null in most cases.


Snippet is simply this:


var params = argumentsu0],
$ = skuid.$;


contactModel = skuid.model.getModel(‘contact’);
contactRow = contactModel.getFirstRow();


var myVar = “”;


// this alert will show null or “”
alert("myvar Value 1 " + myVar);


// this is a null field on the object
myVar = contactModel.getFieldValue(contactRow, ‘JigsawContactId’, true);


// this alert will show undefined
alert("myvar Value 2 " + myVar);


So, question - is this expected behavior and a change we need to address in all of our snippets? I would expect the field to have a null value, not sure why it is showing up as undefined.


Full page repro:



















{{Name}}


{{Model.label}}


































var params = argumentsv0],
$ = skuid.$;

contactModel = skuid.model.getModel(‘contact’);

contactRow = contactModel.getFirstRow();


var myVar = “”;


alert("myvar Value 1 " + myVar);


// this is a null field

myVar = contactModel.getFieldValue(contactRow, ‘JigsawContactId’, true);


alert("myvar Value 2 " + myVar);







Hi Chandra, 

I am also facing the same issue of an undefined model.

Please let me know, if you will get any lead regarding this.

Thanks


UPDATE: Skuid dev folks are looking into this.


Hi Chandra,

We have confirmed that our 10.0 release contained changes that include updating values from “null” to “undefined”. Prior to these changes, Skuid was returning the value of things as “null” that were in fact “undefined”, and this was updated to improve the stability of the product. However, this does mean that you will need to update any code you have that is relying on that value being explicitly null when there is no value. We have updated the releases notes to provide additional information about this change.

Thank you for bringing this to our attention. If you have any further concerns, please let us know.

Karen


Reply