Recent Items
Overview
The "recent" column in the left hand side bar shows those items which have been created or modified recently. Clicking on an item listed in the recent column takes you to that item's record.
Configuration
All configuration is doe in the script "Recent" in a set of variables declared before my favorite line in any script "You shouldn't have to edit below this line"
What constitutes "Recent"?
What makes an edit fall into the "recent" view?
The "Recent" script declares a time-range and a set of fields, wherein changes will count toward recent items. For example the variables $sc_RecentDaysAgo and $sc_RecentHoursAgo are set like this for edits to the contacts table:
So the "Recent" script will search the contacts table for modifications made within those time frames. Once it finds modified records, it looks at the change log for each record to see if any of certain fields were edited. The variable $sc_RecentFields tells us which fields should count toward recent changes: so for example we count edits to a contact's name, notes, or status, but not changes to their address. New records always count as edits.
Now that the script has found edits made to relevant fields within the time frame, it describes the edit according to how that table is configured to be described: this is done in the script "Recent" after the comment "How to I describe / name this record?".
Extending "Recent"
How do I add new fields or actions to recent items?
As described above, any edit to a field in the change log will cause the record to show up in "Recent" so all you have to do is make sure your new field is a part of the change logcalc for z_ChangeLog in that fields table in SeedCodeCompleteData.
If you want edits to the field to be singled out the way we do with Project Status, the the field also needs to be included in the $sc_RecentFields variable, declared in the script "Recent" after the comment "Which fields should count toward recent changes?"
How can I add a "Recent" portal for a whole new table?
The main tables we use in "Recent" -- contacts, projects, and invoices -- have their names hard-coded in several places in the scripts "Recent", "Click on Recent Item", and "End Recent...". You'll need to walk through this script line by line and add an element for your new table each time you see these three tables referred to.
In addition, your new table will need to be added to the change log.
How would I add fields to the display of recent items, or change the display?
The display itself is constructed in the script "Recent" in two places. First, in a SetVariable line right after the comment "Set the content we'll show in Recent", and again in another SetVariable, right after the comment "Set the content for EVENTS we'll show in Recent."
You may want to duplicate these lines as backup before editing them.
We also have a relationship on the graph from the recent item to its primary record (it's contact, project, or invoice), so you can add fields directly to these recent portals. The will only show up for the primary records, however, not for related events. To do this, enter layout mode and navigate to the Recent tab you're interested in, then add a field from the table occurrence related to recent items: if you're working on Contacts, for example, the table occurrence would be "ContactRecent_Contacts". You'll likely want to apply the same conditional formatting to this field that we've used on the display field already there.
Refreshing Recent Items on Startup
Recent items are refreshed during startup as part of the script "Upon Opening", you can turn this off for a quicker opening if you'd like.