I'm trying to run a query in javascript and pass the results to other querys to pull more data. I also want to be able to display this data all in one table so I'm trying to get the results arranged in a javascript map but I seem to be having issues.
This is being built inside of salesforce.com with their AJAX toolkit
The code I have is...
var cn = Query("select id, LastName, FirstName, Middle_Name__c, Gender__c, HomePhone, Birthdate, Birth_City__c," +
"Birth_Country__c, SSN_Encrypted__c, Provider_NPI_ID__c, Primary_Specialty__c," +
"Practicing_Specialty__c, Title, GlobalProviderID__c from contact where Name like " +
"'%" + sBox + "%'");
var PFA;
for (var i = 0; i < cn.length; i++) {
var x = new Array();
var PFA = Query("select id, First_Scheduled_Date__c, Region__c " +
"from Provider_Facility_Associations__c where Provider__c='" + cn[i].Id + "'");
m['cn'] = cn[i];
m['PFA'] = PFA;
m[i] = x;
}
console.log(m['cn']);
Any help would be greatly appreciated.