AJAX problems with non-strings

 sometimes need to convert return parameters to STRINGS to avoid nulls

getItemPrice: function() { var sPrice = '0'; var sApproval = ''; var itemSYSID = this.getParameter('sysparm_catitem_sysid'); var returnItemObj = {}; // Declaring an object var grItem = new GlideRecord('sc_cat_item'); grItem.addQuery('sys_id', itemSYSID); grItem.query(); if (grItem.next()) { sPrice = grItem.price+""; sApproval = grItem.u_approval_type+""; } returnItemObj.price = sPrice; returnItemObj.approval = sApproval; returnItemObj.item = itemSYSID; return (JSON.stringify(returnItemObj)); },


Popular posts from this blog

GlideRecord setValue

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy