You need to sign in to do that
Don't have an account?
Simple Ajax toolkit question for processing reults.
I am using the Ajax toolkit for the first time and had a simple question.
I have a query that looks like this.
userEmailQuery = "Select Email From User WHERE id ="+"'"+userId+"' ";
result = sforce.connection.query(userEmailQuery);
which results in a string that looks like this....{done:'true', queryLocator:null, records:{type:'User', Id:null, Email:'me@mycompany.com', }, size:'1', }
I am having trouble just getting my Email element using the syntax below. What is the proper way to obtain the value of the Email from the above result.
result.Email;
result.get("Email");
Thanks
From the sample code in the docs:
Your result variable contains a variable called records, which is an array of the returned data. The elements of records contain the fields you want.
All Answers
From the sample code in the docs:
Your result variable contains a variable called records, which is an array of the returned data. The elements of records contain the fields you want.
Thanks Wereworlf!
The approach below is how I have it currently working.
So this is the way it needs to process whether we want one record returned or multiple? When I first saw the example and used it, I was assuming it was implying the approach for multiple row records.
I don't feel so bad now.
Thanks again for your help.