Serializing JSON from Apex Apex Class: public with sharing class jsonAccount { public string AccountNameList {get;set;} public jsonAccount() { list accList = [Select Id,Name From Account]; System.debug(JSON.serialize(accList)); AccountNameList = JSON.serialize(accList); } …
March 2012
-
-
Source: http://bobbuzzard.blogspot.in/2010/09/visualforce-lookup.html
-
Source : http://www.codemeonce.com/2012/02/customize-ckeditor-on-forcecom.html
-
Here is the sample code for it: and here is the java script function
-
-
public class simpleHTTPCallOut {public simpleHTTPCallOut(ApexPages.StandardController controller) { } String ErrorMessage; public void Login() { ErrorMessage=”; final string baseUrl = ‘https://login.salesforce.com/‘; final string username = ‘[email protected]’; final string password = ‘test@123’; …
-
Example : var json = ‘{“result”:true,”count”:1}’,obj = JSON.parse(json); alert(obj.count); For the browsers that don’t you can implement it using json2.js.
-
function getQueryStringValue(key, default_){ if (default_==null) default_=””; key = key.replace(/[\[]/,”\\\[“).replace(/[\]]/,”\\\]”); var regex = new RegExp(“[\\?&]”+key+”=([^&#]*)”); var qs = regex.exec(window.location.href); if(qs == null) return default_; else return qs[1];}The getQueryStringValue function is simple …
-
Assume we have a fairly complex JavaScript object defined using literal notation: var obj1 = { b1: true, s1: “text string”, n1: 12345, n2: null, n3: undefined, a1: [ 1,1,2,3,5,8, …
-
JSON-js – JSON in JavaScript. To convert an object to JSON, use JSON.stringify: var json_text = JSON.stringify(your_object, null, 2); To convert a JSON string to a JS object, use JSON.parse: …