function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
finkyfinky 

can anyone tell what's wrong with this syntax

Can anyone tell what's wrong with this syntax:

"Where PostalMailingCode Like '10019%'"

This crashes my entire HTML S-Control even though I know there are Contacts with that zip code.

Full Query:

Code:
//*********** Query ***********************************
var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +
"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +
"FROM Contact c, c.account a " +
"Where PostalMailingCode Like '10019%'" +
"limit 10");

 


Execute EZSAASExecute EZSAAS
There are two issues with it - there is no field PostalMailingCode -it should be c.MailingPostalCode 
and you were also missing a "c." before in your WHERE clause
Try this:
Code:
var result = sforce.connection.query("SELECT c.Phone, c.title, c.firstname, " +
"c.lastname, c.email, a.Id, a.name, a.industry, c.accountId " +
"FROM Contact c, c.account a " +
"Where c.MailingPostalCode Like '10019%'" +
"limit 10");


 

finkyfinky
Thanks.  Works like a charm
Finky