Hi - I see in the documentation that Object Script API methods expect JS arrays where they expect field values. The arrays are to include name/value pairs, one per field. One example is: var x = new Array(); x["amount"]=1000; x["R477842"]={!id}; x["name"]="API Created"; var newId = rbv_api.createRecord("item", x); Is it acceptable to pass a JS object instead of a JS array? For example, I would like to do this for the above: var newId = rbv_api.createRecord("item", {amount:1000,R477842:{!id},name:"API Created"});
Yes, it should have the same effect.
Thanks, Pavel - Nathan
Nathan, let us know if you experience any issues passing an object versus an array.
Thanks,
Matt
Sure thing, Matt. I'll keep an eye out for it. So far it seems to work as I'd expect it to. I've passed Date objects, dates as milliseconds, and booleans, and they all landed in the record.