Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, August 24, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Incorrect syntax near ')'. : Incorrect syntax near the keyword 'SELECT'.
Rob Bartram
Posts: 98
 
Incorrect syntax near ')'. : Incorrect syntax near the keyword 'SELECT'.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 11:53 AM
Hello,

I have a user with an account group that returns accounts that have sceduled activities for the next 1000 days. This group is the default account group that opens on startup of SLX. Sometimes, when the group is trying to load upon startup, he gets this error: "Incorrect syntax near ')'. : Incorrect syntax near the keyword 'SELECT'.". I was testing something logged into as him today and received the error and captured the offending SQL statement. I've also received similar reports for other users using the "My Activities For Today" contact group, I suspect they are related, but I'm not 100% certain.

The problematic statement is below. The offending part is in the "Executed SQL" section in all upper case. It's like the provider is just injecting this code, but at the wrong place and time. When the group works properly, the offending SQL is completely omitted from the Executed SQL

SLX Version: 7.2.2, Upgraded recently from 6.2.6

---------- Client SQL ---------
SELECT DISTINCT A1.CONTACTID, A1.NAMELF, A1.ACCOUNT, A2.CITY A2_CITY, A2.STATE A2_STATE, A1.WORKPHONE, A1.MOBILE, A1.EMAIL, A1.NAME, A1.LASTNAME_UC, A1.FIRSTNAME FROM CONTACT A1 INNER JOIN ADDRESS A2 ON (A1.ADDRESSID=A2.ADDRESSID) LEFT OUTER JOIN ACTIVITY A3 ON (A1.CONTACTID=A3.CONTACTID) WHERE (A3.STARTDATE>=[DBTYPE_VARIANT,"7/28/2008 4:00:00 AM"] AND A3.STARTDATE<[DBTYPE_VARIANT,"7/30/2008 4:00:00 AM"]) AND (A3.TYPE=[DBTYPE_STR | DBTYPE_BYREF,"262146"]) AND (A3.USERID=[DBTYPE_STR | DBTYPE_BYREF,"U6UJ9A00000A"]) ORDER BY A1.LASTNAME_UC ASC, A1.FIRSTNAME ASC
---------- Executed SQL ----------
select distinct a1.contactid, (isnull(a1.lastname,'') + ', ' + isnull(a1.firstname,'')) namelf2, a1.account, a2.city a2_city, a2.state a2_state, a1.workphone, a1.mobile, a1.email, (isnull(a1.firstname,'') + ' ' + isnull(a1.lastname,'')) name9, a1.lastname_uc, a1.firstname from contact a1 inner join secrights s_aa on (s_aa.accessid = 'u6uj9a00000a' and a1.seccodeid = s_aa.seccodeid ) inner join address a2 on (a1.addressid=a2.addressid) left outer join activity(SELECT * FROM ACTIVITY WHERE (ACTIVITY.ACTIVITYID IN (SELECT uax.ACTIVITYID FROM USER_ACTIVITY uax WHERE uax.USERID = 'U6UJ9A00000A')) OR (ACTIVITY.ACCOUNTID IN (SELECT acx.ACCOUNTID FROM ACCOUNT acx INNER JOIN SECRIGHTS sr ON (sr.SECCODEID = acx.SECCODEID AND sr.ACCESSID = 'U6UJ9A00000A'))) OR (ACTIVITY.USERID IN (SELECT ucx.CALUSERID FROM USERCALENDAR ucx WHERE ucx.USERID = 'U6UJ9A00000A'))) A3 ON (A1.CONTACTID=A3.CONTACTID) AND A3.ACCESSID_='U6UJ9A00000A' where (a3.startdate>=? and a3.startdate
Has anyone else experience a similar issue? I'm wondering if it's a wide scale issue of if it's something related to our installation.

Thank you.
...Rob
[Reply][Quote]
Jim
Posts: 8
 
Re: Incorrect syntax near ')'. : Incorrect syntax near the keyword 'SELECT'.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 08 1:29 PM
We're not having that issue but the executed sql is broken at

...

left outer join activity (

...

The activity should not be there. The provider is not parsing the sql in the client sql correctly.

You may be able to rewrite your group list to avoid this issue. It looks to me like your asking to see only accounts for contacts with an activity in the next 1000 days. Try a left join on activities instead of an outer join and see if it fixes the executed sql.
[Reply][Quote]
Rob Bartram
Posts: 98
 
Re: Incorrect syntax near ')'. : Incorrect syntax near the keyword 'SELECT'.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 08 1:43 PM
Thanks for the reply Jim.

I don't see any place in Saleslogix to distinguish between a "Left Join" and a "Left Outer Join". I just see the ability to specify "Inner","Left" and "Right" joins. The linkage between the Account and Activity tables is set to "Left", which is being translated to "Left Outer Join" by Saleslogix.

I agree that the uppercase part of the executed query should not be there. Something whacky is going on and it is happening randomly for a couple users.

I need to find out where the injected part of the statement is being executed from, maybe that will shed some light on the problem.

Thanks again for your reply.
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Incorrect syntax near ')'. : Incorrect syntax near the keyword 'SELECT'.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 08 6:36 PM
'Left Outer Join' is just the verbose way of saying 'Left Join' - they're the same.

Phil
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/24/2025 6:25:33 PM