{ "id": "160066", "key": "AC-3598", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2016-05-17T14:02:15.000+0000", "created": "2016-05-05T17:29:18.000+0000", "labels": [], "versions": [ { "id": "17038", "name": "Appcelerator Studio 4.5.0", "archived": false, "released": false } ], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-05-17T14:02:15.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14559", "name": "ArrowDB" } ], "description": "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:\r\n\r\n400: Failed to send message: Invalid ACS type: file\r\n\r\nMaybe 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?\r\n\r\nHere is my code:\r\n\r\nCloud.Messages.create({\r\n to_ids: to.join(','),\r\n body: 'New Message',\r\n subject: 'Test Message',\r\n custom_fields:\r\n {\r\n \"[ACS_File]file_id\":videoFile, //videoFile is an Id string\r\n \"[ACS_User]owner_id\":to.join(','),\r\n\r\n \"pausedAt\" : pausedAt,\r\n \"correctAnswer\": correctAnswer,\r\n \"a2\" : a2,\r\n \"a3\" : a3\r\n }\r\n}, function (e) {\r\n if (e.success) {\r\n var message = e.messages[0];\r\n alert('Success:\\n' +\r\n 'id: ' + message.id + '\\n' +\r\n 'subject: ' + message.subject + '\\n' +\r\n 'body: ' + message.body + '\\n' +\r\n 'updated_at: ' + message.updated_at);\r\n \r\n } else {\r\n alert('Error:\\n' +\r\n ((e.error && e.message) || JSON.stringify(e)));\r\n }\r\n});\r\n}\r\n\r\n\t\r\nI think the documentation on relations is somewhat thin: docs.appcelerator.com/arrowdb/latest/#!/guide/relationalfields I can't seem to figure out the \"fieldname_id\" part? in [ACS_] For what I understand, it should be: [ACS_File]ID_id if it is the id field of the File object I want refference!?\r\n\r\nThe confusing thing is that for example images is refferenced like this: [ACS_Photo]picture_id !? How should I know that the \"fieldname\" is called \"picture\" for the Photo object. Where is that documented? Sorry, but it is frustrating. And I've tried all thinkable combinations for the File object without luck..\r\n", "attachment": [], "flagged": false, "summary": "Relation fields in ArrowDB Appcelerator and File objects", "creator": { "name": "frodomau", "key": "frodomau", "displayName": "Jan Frode Maurice", "active": true, "timeZone": "Europe/Oslo" }, "subtasks": [], "reporter": { "name": "frodomau", "key": "frodomau", "displayName": "Jan Frode Maurice", "active": true, "timeZone": "Europe/Oslo" }, "environment": "Mac OSX 10.11.4 Titanium SDK 5.2.2GA", "comment": { "comments": [ { "id": "385321", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, \r\n\r\nI tried to test the code you provided. It seems you have a code error. There is no field's called custom_fields in Cloud.Messages. Can you please explain a little more on what you are trying to do. Also provide a clear code that youa re using. \r\n\r\nRegards,\r\nSharif.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-05-10T19:05:42.000+0000", "updated": "2016-05-10T19:05:42.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }