Recently I had an un-expected behaviour happen. I had created a custom module using the define statement which was then used in a client side script. Below is simplified version of the custom module.
Code:
define([],
function() {
validateDate=function(dt){
return dt.getMonth()==0;//Just for illustration purposes we’re in January
};
return {
isJanuary: function(dt){
return this.validateDate(dt);
}
};
});
The validateDate function was defined incorrectly. it should have been
Code:
function validateDate
what really surprised me was that validateDate = function() .. actually overwrote or broke a NetSuite global client side function of the same name. So while I won’t make this mistake again, how did expression validateDate = function(dt)… in my custom module cause this?
John
This is a cached copy. Click here to see the original post.