11/25/2024 9:23:36 PM
|
|
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.
|
|
|
|
Custom Advanced Lookup Result Groups.
Posted: 20 Apr 06 10:34 AM
|
medical abortion pill how much does the abortion pill cost redirect fiogf49gjkf0d I'm trying to implement a custom advanced lookup that will act like the standard SLX advanced lookup. Here's a simple example to illustrate how I'm currently creating the group ('strSQL' is contructed based on the search criteria entered):
strSQL = "(Select ContactID From Contact Where LastName Like 'St%')" strFirstID =
With Application.BasicFunctions .CreateTempGroup "Contact", "", "ContactID", " IN ", strSQL, strFirstID .SetCurrentClientGroup "Contact: " End With
This works for simple SQL statements like the one above but for more complex SQL involving multiple tables & UNIONS it fails without generating a run-time error (the record specified by 'strFirstID' appears but the caption bar reads "no records" even though I know there are 3 results). I'd like the group I create to behave the same as the SLX groups that are created from SLX advanced lookups, so if the group is saved then selected in the future it remains accurate.
Does anyone know the best way to accomplish this or if it's even possible?
Thanks, Greg |
|
|
|
Re: Custom Advanced Lookup Result Groups.
Posted: 21 Apr 06 6:04 AM
|
fiogf49gjkf0d Hmm, never created a temp group through code. Is there a way for you to create a group throught the Query Builder that does the same thing? If you can get it to work there then you can click the 'View SQL' button to copy the actual SQL it is using to get the results.
Hope this helps. John G. |
|
|
|
Re: Custom Advanced Lookup Result Groups.
Posted: 21 Apr 06 9:10 AM
|
fiogf49gjkf0d Greg,
The provider is fussy about unions. I did a bit of experimenting with the grid and a union statement and this is what I found:
This does not work through the provider: dbGridTest.SQL = "Select ContactID from Contact Where LastName like 'A%' Union Select AccountID from Account Where Account like 'A%'"
It is a straight query with no alias table names.
BUT dbGridTest.SQL = "Select ContactID from Contact A1 Where LastName like 'A%' Union Select AccountID from Account A1 Where Account like 'A%'"
When I alias the tables the same, the query works.
Hope this helps!
Dawn
|
|
|
|
Re: Custom Advanced Lookup Result Groups.
Posted: 21 Apr 06 9:18 AM
|
fiogf49gjkf0d Thanks John. I've decided to go back to the drawing board on this. I used your suggestion as a starting point and now seem to be on the right track. |
|
|
| |
|
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!
|
|
|
|
|
|
|
|