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: Specify a dynamic date range for a group
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 08 1:50 PM
I've run into this issue several times where I need to create a group of contacts or accounts where activity has occurred between two dates. This is fine if the dates are static, but they need to be dynamic. For example, show contacts with history 5 to 8 days ago. For this I tried using a SELECT statement in the group conditions but it would not work.

SELECT DATEADD(dd,-5,GETDATE())

Is there any way to setup a group that uses dynamic dates?

Thanks,
John G.
[Reply][Quote]
Rohan Verghese
Posts: 2
 
Re: Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 08 2:38 PM
For the LAN Client, in the dialog that specifies the condition, you can check the "Use Value as Literal" checkbox. Then enter the condition to get dynamic dates.

Sadly, this doesn't work with the SLX Web Client. (At least in 7.2.)
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 08 6:54 AM
I tried checking the 'literal' checkbox and it still did not work. I believe when that box is checked the SQL will look something like

... WHERE a.modifydate >= 'SELECT DATEADD(dd,-7,GETDATE())'

This results in 0 records returned.

Thanks,
John G.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 08 6:59 AM
I tried checking the 'literal' checkbox and it still did not work. I believe when that box is checked the SQL will look something like

... WHERE a.modifydate >= 'SELECT DATEADD(dd,-7,GETDATE())'

This results in 0 records returned.

What I was thinking of doing is creating a view in the database. So the view would be something like

SELECT DISTINCT contactid
FROM history
WHERE modifydate >= 'SELECT DATEADD(dd,-7,GETDATE())'

Then I can setup a group condition that says show me all the contact IDs that are IN SELECT contactid FROM c_CustomViewName

Hmmm, I think that would work. Of course the only problem with this approach is if you have remote clients. How do you send a custom view out to a remote client? I think there is a way to do this that was new with 7.0 but I don't remember. Anyone?

Thanks,
John G.
[Reply][Quote]
Nick McLean
Posts: 50
 
Re: Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 08 8:36 AM
Hi John

Remove the select from your value after choosing use literal eg

In the group builder condition ...

Fieldname = History.ModifyDate
FieldType = Date/Time
Operator = (>) greater than
Value = dateadd(dd, -7, getutcdate())
Use value as a literal = ticked

alternatively

Accountid
in
select accountid from history where modifydate > dateadd(dd, -7, getutcdate())
without the use as literal ticked

Kind Regards

Nick
[Reply][Quote]
Harendra Sinha
Posts: 66
 
Re: Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 08 8:51 AM
Hi John,
I have checked and is working ..
do as follows In codition box
1. Select the operator required
2. Check 'Use value as literal'
3. add this - DATEADD(dd,-7,GETDATE()) in the 'value is' box without quotes and select

-Harendra
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Aug 08 7:57 AM
Ah... Yes this worked. I did notice that you must check 'Use value as literal' before attempting to enter the value.

Thanks to all!
[Reply][Quote]
Harendra Sinha
Posts: 66
 
Re: Specify a dynamic date range for a groupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Aug 08 9:20 AM
Quote:
Originally posted by John Gundrum

Ah... Yes this worked. I did notice that you must check 'Use value as literal' before attempting to enter the value.

Thanks to all!


that's why i have mentioned the sequence of steps..
[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:24:38 PM