23 Mar 2017

Sales Force List of List Object

Remote Action List of List Object

global with sharing class TagLogApp {
    public static List<List<Object>> getChartData() {
        List<List<Object>> data = new List<List<Object>>();
        Object locName;
        String locValue;
      
        List<AggregateResult> locationNames = [select Location__c,COUNT(Name) cnt from Tag_Log__c GROUP BY Location__c ];
        data.add(new List<Object>{'Locations', 'Tag Count'});
        
        for(AggregateResult rd : locationNames) {
            locName = rd.get('Location__c'); 
            locValue = locName  != Null ? (String)locName : 'Others';
            data.add(new List<Object>{locValue , Double.ValueOf(rd.get('cnt'))});           
        }        
        return data;
    }

   @RemoteAction
   public static  List<List<Object>>  GetAll(String searchText)
   {
        return TagLogApp.getChartData();
   }     
}

17 Feb 2017

Node Js


Check Version :
npm -v or npm view npm version

npm install npm -g or 
npm install npm



var http = require("http");
http.createServer(function (request, response) {

   // Send the HTTP header 
   // HTTP Status: 200 : OK
   // Content Type: text/plain
   response.writeHead(200, {'Content-Type': 'text/plain'});
   
   // Send the response body as "Hello World"
   response.end('Hello World\n');
}).listen(8081);

// Console will print the message
console.log('Server running at http://127.0.0.1:8081/');

Now execute the main.js to start the server as follows −
$ node main.js
Verify the Output. Server has started.
Server running at http://127.0.0.1:8081/