You need to sign in to do that
Don't have an account?
Adivi
scontrol using AJAX toolkit
I created an scontrol using the AJAX tookit... It was able to query the database for me and tell me exactly how many records existed... This was done by doing something like
sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");
var accName = "{!Account_Name}";
var queryResult = sforceClient.Query("select billingcity, id from account where Name=\'"+accName+"\'");
if(queryResult.size == 1)
{
var account = queryResult.records[0];
alert("Billing City is: " + account.billingcity+"\nID = " + account.id);
}
But the program was giving an error at the alert line saying that "billingcity is null or not an object".
Can anyone help me on this.. Thanks
sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");
var accName = "{!Account_Name}";
var queryResult = sforceClient.Query("select billingcity, id from account where Name=\'"+accName+"\'");
if(queryResult.size == 1)
{
var account = queryResult.records[0];
alert("Billing City is: " + account.billingcity+"\nID = " + account.id);
}
But the program was giving an error at the alert line saying that "billingcity is null or not an object".
Can anyone help me on this.. Thanks
The way to access the fields on a record is by using the get and set functions of the record.
In you sample it should be account.get("billingcity");
When I was trying to access the casenumber as mentioned by you after quering the case table like this
alert(cases.get("casenumber"));
This was the error
Line:60
Char:8
Code:0
Error:'undefined' is null or not an object
URL:https://tapp0.salesforce.com/servlet/servlet.Integration?lid=01NT000000002Pt&eid=500T0000000TqvM&enc=UTF-8