I am trying to load Sales Force data into a Data Grid using the CRUD example.
I have generated JSON from a Sales Force Query. Here is an extract:
{
"queryLocator":null,
"done":true,
"records":[
{
"Id":null,
"CreatedDate":"2016-08-17T20:43:10.000Z",
"Leader__c":"GF",
"Lectionary6__r":{
"Id":null,
"Colour__c":"Green",
"Lectionary_Date__c":"2016-09-04",
"Period_Name__c":"Trinity 15",
"Selected_Reading_Line__c":"Deuteronomy 30.15\u2013end, Psalm 1, Philemon 1\u201321, Luke 14.25\u201333"
},
"Location__c":"Ashburton",
"Service_Date__c":"2016-09-04",
"Service_Time__c":"08:00",
"Service_Type__c":"HC 2"
},
{
"Id":null,
"CreatedDate":"2016-08-17T20:43:10.000Z",
"Leader__c":"GF",
"Lectionary6__r":{
Here is the JSON which comes from the CRUD example
{
"total":"105",
"rows":[
{
"id":"3",
"firstname":"fname1234BBBB",
"lastname":"lname10....",
"phone":"Lacock 4919999",
"email":"
name991@gmail.com"
},
{
"id":"7",
"firstname":"fname413ffffggxx",
"lastname":"lname999x",
"phone":"0123456",
"email":"
name4@gmail.com"
},
Here are the important lines from get_users.php which create the JSON array.
define("USERNAME", "--------------------");
define("PASSWORD", "--------");
define("SECURITY_TOKEN", "-----------");
require_once ('soapclient/SforceEnterpriseClient.php');
$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/generateEnterprise.wsdl");
$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);
$query = "SELECT Service_Date__c, Service_Time__c, CreatedDate, Notes__c, Leader__c, Location__c, Service_Type__c, Lectionary6__r.Lectionary_Date__c,Lectionary6__r.Colour__c,Lectionary6__r.Period_Name__c, Lectionary6__r.Selected_Reading_Line__c from Service3__c WHERE Web_Publish__c = True ORDER BY Service3__c.Service_Date__c, Service3__c.Service_Time__c
";
$response = $mySforceConnection->query($query);
$data = json_encode((array)$response);
echo $data;The SF JSON validates - the only difference I can see relates to the header - the EasyUI includes the number of rows. Is this important ? Can anyone suggest what I need to change to get the SF data to load into the grid ? Any help or suggestions much appreciated. Thanks.