I am having trouble with this calculation.
On my dashboard layout, I would like for a portal to list all the records with a specific STATUS and that was opened 3 days ago.
What does your calculation look like so far? That is, your current portal filter.
Assuming you have a field with the status you want and a date field as well.
Where "Status" and "theDate" are names of fields, then you might have a filter like: Status = "closed" and theDate = Get(CurrentDate) -3
(best not to hard-code the "-3", but I left it there for illustration)
Status = Critical and Date_Created ≤ ( Get ( CurrentDate ) - 3 )
I did not set it as a filter within the portal. But why you say not to hard code the -3? Let me give that a go.
fmpdude wrote:What does your calculation look like so far? That is, your current portal filter.
I would not assume that is a portal filter, nor would I recommend one, depending on the
number of records that need to be filtered.
One could create a relationship based on dashboard globals, or perform a SQL query that retrieves the matching IDs to drive a relationship. Query criteria are taken from global fields in the Dashboard table.
DashboardTable::foundIDs = QueryTable::id
Set Variable [ $found ;
ExecuteSQL ( "
status = ? AND
theDate = ?
" ; "" ; "" ; DashboardTable::gFilterStatus ; Get ( CurrentDate ) - DashboardTable::gFilterDateOffset
If [ not IsEmpty ( $found ) ]
Set Field [ DashboardTable::gFoundIDs ; $foundIDs ]
Show Custom Dialog [ "none matching" etc. ]
# [ doesn't change current matching set in gFoundIDS ]
(I'm surprised that for once, you're not suggesting SQL ... )
Let me gift you an umlaut; I've a few spare ones lying around ...
xxx202xxx wrote:But why you say not to hard code the -3?
But why you say not to hard code the -3?
Because whenever you feel like wanting to see all records created, say, 4 days ago, you need to change some inner workings (calc/script), instead if simply changing a value in the UI.
Retrieving data ...