You need to sign in to do that
Don't have an account?
testor
User input on apex.query with FLEX 2
With Flex 2, I'm trying to use TextInput to allow the user to enter information for the apex query, but haven't been able to successfully pass the information.
Here's how I retrieve the information:
<mx:FormItem label="Enter an organization name to search: ">
<mx:TextInput id="orgname" width="100%"/>
</mx:FormItem>
Here's how I'm trying to use the data in the query:
apex.query("Select Name, Phone, From Contact where account.name=orgname", new AsyncResponder(
Compiles fine, but when I run it, I get the following error:
(com.salesforce.results::Fault)#0
detail = (Object)#1
fault = (Object)#2
column = 72
exceptionCode = "MALFORMED_QUERY"
exceptionMessage = "
From Contact where account.name=orgname
^
ERROR at Row:1:Column:72
unexpected token: orgname"
row = 1
xsi:type = "sf:MalformedQueryFault"
faultcode = "sf:MALFORMED_QUERY"
faultstring = "MALFORMED_QUERY:
From Contact where account.name=orgname
^
ERROR at Row:1:Column:72
unexpected token: orgname"
Here's how I retrieve the information:
<mx:FormItem label="Enter an organization name to search: ">
<mx:TextInput id="orgname" width="100%"/>
</mx:FormItem>
Here's how I'm trying to use the data in the query:
apex.query("Select Name, Phone, From Contact where account.name=orgname", new AsyncResponder(
Compiles fine, but when I run it, I get the following error:
(com.salesforce.results::Fault)#0
detail = (Object)#1
fault = (Object)#2
column = 72
exceptionCode = "MALFORMED_QUERY"
exceptionMessage = "
From Contact where account.name=orgname
^
ERROR at Row:1:Column:72
unexpected token: orgname"
row = 1
xsi:type = "sf:MalformedQueryFault"
faultcode = "sf:MALFORMED_QUERY"
faultstring = "MALFORMED_QUERY:
From Contact where account.name=orgname
^
ERROR at Row:1:Column:72
unexpected token: orgname"
Your SOQL statement should be:
Code:
Note: This is not a search or a wildcard so your user will have to spell the Account Name correctly for it to return anything.
Jon Davies
360 Vantage
3115 S. Price Road
Chandler, AZ 85248
I've got the query working (with wildcards even), but now I need to add the Account.Name to my data grid. The datafield can't be expressed as "Account.Name". I tried to fox it with a subquery fetching first and last names from contact within the main query fetching name from account, but I couldn't get FirstName or LastName to work in the datafield with that query. I don't want to use two arrays if I can avoid it.
I'd sure appreciate another bit of help!