Anyone have knowledge about relations and ArrowDB? I'm adding a User object as an relation field to a Message object, and that works fine. But when I try to add an relation to a File object from the same Message object I get the following error:
400: Failed to send message: Invalid ACS type: file
Anyone have a clue?
Maybe I'm using the wrong notation for the File object!? I've tried: [ACS_File], [ACS_Files] without any luck?....[ACS_User] works like a charm?
Here is my code:
Cloud.Messages.create({
to_ids: to.join(','),
body: 'New Message',
subject: 'Test Message',
custom_fields:
{
"[ACS_File]file_id":videoFile,
"[ACS_User]owner_id":to.join(','),
"pausedAt" : pausedAt,
"correctAnswer": correctAnswer,
"a2" : a2,
"a3" : a3
}
}, function (e) {
if (e.success) {
var message = e.messages[0];
alert('Success:\n' +
'id: ' + message.id + '\n' +
'subject: ' + message.subject + '\n' +
'body: ' + message.body + '\n' +
'updated_at: ' + message.updated_at);
//Her gikk alt bra og melding og video er lastet opp. På tide å sende en push :-)
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
}