This is my simple code to create a unit with profile fields
sess.createUnit(sess.getCurrUser(), infoArr[0], this.state.selectedHWID, flags, function (code, obj) {
console.log('reposne code is : ')
console.log(code)
if (code === 0) {
console.log(obj)
obj.updateProfileField({itemId: obj._id ,n:"year",v:"2020"}, function(code,col){
console.log(' returned code' +code)
console.log(col)
})
}
})
But i have got
{"error":4, "reason":"VALIDATE_PARAMS_ERROR: {itemId: long, n: text, v: text}"}
in network request console
i already have loaded "itemProfileFields"
i tried to do :
sess.getIIem(returnObj._id).updateProfileField..
but the item returned is null but i don't know why
so kindly can you explain me the correct procedure to reach updateProfileField method, is it by getITem or by returnObj.updateProfileField?
thanks