Time for action – creating a panel to show commentary entries
You need to have completed the last example before starting this example. It's no use trying to fetch ACS content without storing some first. Perform the following steps to create a panel showing commentary entries:
Ensure that the following calls are included:
var forex = require('forexCommentary'); forex.init();
We need a function that will get the last three custom objects from ACS. The query command has two parameters. The first defines the query, and the second is where you specify what you want to do with the results that are returned. In the following example, the object returned is called
forexCommentary
:function getLast3Comments(_args) { Cloud.Objects.query({ classname: 'forexCommentary', limit: 3, order : '-created_at' }, function (e) { if (e.success) { _args.success(e.forexCommentary); } else { _args.error({error: e.error}); } ...