Page 1 of 1

Movable Date Range in Criteria defining Relationship

PostPosted: Wed Feb 20, 2008 10:05 am
by Marvin
The contactactivitysimple shows all activity for the contact. When multiple future activities are scheduled, the portal becomes currently meaningless. I would like to show the activity over a week starting three days ago and ending three days from today. Is there a way to define a new table occurrence, with a date range, so that only those activities for that contact that have occurred over the last three days or will occur in the next three days (a seven day range that included today)?

I hope that makes sense.

PostPosted: Wed Feb 20, 2008 5:44 pm
by John Sindelar
Good idea Marvin.

I might actually change the ContactActivity relationship, rather than creating a new table occurrence. I've begin by creating a new global text field in Filters; something like "ShowThisWeek". Then create two new calcs in Contacts:

ContactDateFrom_k_Calc would be: if ( Filters::ShowThisWeek = "Yes" ; Get ( CurrentDate ) -3 ; Date ( 1 ; 1 ; 1968 ) )

ContactDateTo_k_Calc would be: if ( Filters::ShowThisWeek = "Yes" ; Get ( CurrentDate ) + 3 ; Date ( 1 ; 1 ; 2025 ) )

Then add two new criteria to the ContactActivity relationship like this:

ContactDateFrom_k_Calc <= ApptDateEndCalc_k
ContactDateTo_k_Calc >= ApptDateStart_k

This way, when you have ShowThisWeek set to "Yes" you'll see the contact's activities for your six day range, and when it is set otherwise you can see all the contact's activity.

PostPosted: Fri Feb 22, 2008 12:55 pm
by Marvin
Thanks John.

I have tried this, but nothing seems to be coming through the new filtered relationship. I made the change to the CotactActivity Simple relationship as well with the same results.

I have tested my if statement calcs and they evaluate to similar date terms, so that should not be an issue.

How do I trouble shoot this?

Marvin

PostPosted: Fri Feb 22, 2008 1:00 pm
by John Sindelar
I'd check to make sure your calcs are returning the type Date. If that doesnt help, remove the second date operator and perhaps change the first one to =

HTH

PostPosted: Fri Feb 22, 2008 1:54 pm
by Marvin
Thanks John.

Data Type was set wrong on the calculation.

Marvin