This error is also (sometimes?) caused by specifying a value for Id
in fibery.createEntity:
AND - the entity is NOT created.
const utils = context.getService('utils')
const entity = args.currentEntities[0]
const type = entity.Type
const dateTime = new Date().toString()
console.log(`\n=========== Mark as Done "${type}" - ${dateTime} ===========\n`)
const newId = utils.uuid()
const templ = {
"Rank": 10000,
"Name": entity.Name + ' ' + dateTime,
"Id": newId, //-- setting this causes error
"State": "Not Started",
"Enabled": true,
}
console.log( `🚗 create new entity "${type}": ${JSON.stringify(templ,null,2)}` )
const result = await fibery.createEntity(type, templ)
console.log( ` result: ${JSON.stringify(result, null, 2)}` )