You need to sign in to do that
Don't have an account?
TCAdmin
Variable matching
I've got this code and I'm trying to do a query of the system using a JS variable as the matching value. The "id" field is the 18 digit Account Id value. I'm trying to pull all Opportunities that are associated with the Account with this id. When I alert the oppValues I get the following values even though I know there are Opportunities associated with the Account Id I'm using. Can someone give me the syntax that would do what I want?
Query Result [1]:
size: 0
queryLocator: null
done: true
QueryResult [1] ***********************************
Code:
Thanks in advance for any help.
Query Result [1]:
size: 0
queryLocator: null
done: true
QueryResult [1] ***********************************
Code:
var account = accValues.records[cnt];
var id = account.get("Id");
var oppValues = sforceClient.query("SELECT AccountId, Amount FROM Opportunity WHERE AccountId = 'id' ");
Thanks in advance for any help.
var account = accValues.getArray("records")[cnt];
You might not have an array in your outer loop.
Message Edited by zak on 02-26-2007 09:19 AM
Thank you, that works perfect. I knew it had to be just an error with the quotes but I couldn't figure it out.