{ "fields": { "subject": { "type": "varchar", "required": true }, "from": { "type": "varchar", "db": false }, "to": { "type": "varchar", "db": false }, "cc": { "type": "varchar", "db": false }, "bcc": { "type": "varchar", "db": false }, "body": { "type": "text" }, "status": { "type": "varchar" }, "attachments": { "type": "linkMultiple" }, "parent": { "type": "linkParent" }, "dateSent": { "type": "datetime", "default": "javascript: return this.dateTime.getNow(15);" }, "createdAt": { "type": "datetime", "readOnly": true }, "modifiedAt": { "type": "datetime", "readOnly": true }, "createdBy": { "type": "link", "readOnly": true }, "modifiedBy": { "type": "link", "readOnly": true }, "assignedUser": { "type": "link", "required": true, "default": "javascript: return {assignedUserId: this.getUser().id, assignedUserName: this.getUser().get(\"name\")};" }, "teams": { "type": "linkMultiple" } }, "links": { "createdBy": { "type": "belongsTo", "entity": "User" }, "modifiedBy": { "type": "belongsTo", "entity": "User" }, "assignedUser": { "type": "belongsTo", "entity": "User" }, "teams": { "type": "hasMany", "entity": "Team" }, "attachments": { "type": "hasChildren", "entity": "Attachment", "foreign": "parent" }, "parent": { "type": "belongsToParent", "entities": ["Account", "Opportunity", "Case"], "foreign": "attachments" } }, "collection": { "sortBy": "dateSent", "asc": false, "boolFilters": ["onlyMy"] } }