6/21/2025 2:33:10 AM
|
|
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!
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.
|
|
|
|
Legacy: Grid : dynamically set SQL to Grid
Posted: 15 Nov 07 3:04 AM
|
I want to set grid sql on runtime, coz i need to group some fields and reterive max field value.
this is modified sql SELECT distinct A1.PRODUCTID, A1.ACTUALID, A2.SHORTDESCRIPTION A2_SHORTDESCRIPTION,A3.PRICE A3_PRICE , A3.CURRENCY A3_CURRENCY, A2.LANG A2_LANG FROM sysdba.PRODUCT A1 left JOIN (select productid,max(price)price,currency from sysdba.c_productprice group by productid,currency) A3 ON (A1.PRODUCTID=A3.PRODUCTID) left JOIN sysdba.C_PRODUCT A2 ON (A1.PRODUCTID=A2.PRODUCTID) WHERE (A2.LANG='e') AND (A3.CURRENCY='chf') ---- this is orginal sql SELECT DISTINCT A1.PRODUCTID, A1.ACTUALID, A2.SHORTDESCRIPTION A2_SHORTDESCRIPTION, A3.PRICE A3_PRICE , A3.CURRENCY A3_CURRENCY, A2.LANG A2_LANG FROM sysdba.PRODUCT A1 INNER JOIN sysdba.C_PRODUCTPRICE A3 ON (A1.PRODUCTID=A3.PRODUCTID) INNER JOIN sysdba.C_PRODUCT A2 ON (A1.PRODUCTID=A2.PRODUCTID) WHERE (A2.LANG='e') AND (A3.CURRENCY='chf')
--- i hope somebody help me! |
|
|
|
Re: Legacy: Grid : dynamically set SQL to Grid
Posted: 16 Nov 07 9:22 AM
|
Legacy, this is all that Grid Condition stuff right? Not conducive to complex SQL Statements......In days of old......I don't even think IN() clauses were supported that well.....but I'm old, memory is fading, and I need some beer.....
anyway.....
We used to run a massive series of SQL statements and come up with a list of ID fields for the Row ID's that the Grid was contingent upon.....
then we added a series of OR grid conditions to the grid itself....then refresh the grid.
SO (and no I don't remember the exact syntax) QueryAddConditon Gridname, "PRODUCTID", "=", "pA2EK0000wererer", "OR" QueryAddConditon Gridname, "PRODUCTID", "=", "pA2EK0000wererer", "OR"
etc. |
|
|
|
Re: Legacy: Grid : dynamically set SQL to Grid
Posted: 16 Nov 07 6:21 PM
|
On the old Grids, if I am not mistaken, the IN clause was represented by the "Starting with" and "Contains" keyworks, but that may add "%" at the end and at the front accordingly.
What version is this being ran? I know it is a legacy view, but if this is being ran on 6.2.x or higher you may be able to use the Query Optimizer inside the SLX Profiler to alter the query. |
|
|
|
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!
|
|
|
|
|
|
|
|