Hey guys,
Thanks for being here! What should be the value of 'orderIncidentID' here if you want the order be filled by another query its 'additionalScope'?
insertOrderItemIncidentRetool.trigger({
additionalScope: {
orderIncidentID: id,
},
The other query looks like this. Right now this is not working, claiming my id is not an integer. But when I 'hardcode' the value, it is working. Also, the console shows it is an integer before inserting it. I am using the .then syntax. For the full custom javascript query, see below. What can it be?
Full custom query:
insertOrderIncidentRetool.trigger({
additionalScope: {
id: orderData.selectedRow.data.id,
},
onSuccess: function(data) {
console.log(orderData.selectedRow.data.id)
}
}).then((data) => {
const {id} = data.insert_order_incident_one
return {id}
}).then(({id}) => {
console.log(id)
insertOrderItemIncidentRetool.trigger({
additionalScope: {
orderIncidentID: id
},
onSuccess: function(data) {
console.log('succeeded!')
}
})
})