You need to sign in to do that
Don't have an account?
Get a value from json
i have a javascript that is querying my custom object. what i want is to get an email value. this is my javascript
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
var result = sforce.connection.query("Select Main_Email__c From Candidate_ATS__c where Name ='{!JobApplicant_ATS__c.Candidate_Name__c}' ");
var records = result.getArray("records");
//If there are no record
if (records.length == 0){
alert("no record");
}
//If there is a record
else{
alert(records);
}
When i alert records this is what am getting:
{type:'Candidate_ATS__c', Id:null, Main_Email__c:'abc@abc.com', }
pliz help get my email i.e. abc@abc.com
First, I would study up on javascript.
Second, I would change my alert statement to:
Also, it seems short sighted to have a where clause select, what should be a single record, based off a name. What happens when there are two "Tom Smith" in your system?