Welcome, Guest. Please Login or Register
Tinderbox
  News:
Can't see captcha images when registering in Safari? - please use Chrome or Firefox for registration process.
  HomeHelpSearchLoginRegister  
 
Pages: 1
Send Topic Print
Data Agent (Read 2170 times)
Michael Becker
Full Member
*
Offline



Posts: 11

Data Agent
Sep 06th, 2011, 10:45am
 
What syntax would I use if I want to create a search agent that pulls all the "calls," i.e. notes with a start date that happened in a given month, e.g. July 2011?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4107
Southsea, UK
Re: Data Agent
Reply #1 - Sep 6th, 2011, 11:14am
 
Agent's query:

$StartDate.month==7 & $StartDate.year== 2011

See Date.month and Date.year.

Of course, the above only works for July 2011. To change the target month or year, you could fiddle with the query but a less techie way might be to add two Number-type user attributes, $MyMonth and $MyYear. Set these these as key attributes for your agent. Now use the query:

$StartDate.month==$MyMonth(agent) & $StartDate.year== $MyYear(agent)

Now, to reset the month/year of enquiry, you open the agent and change $MyMonth and/or $MyYear.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
Michael Becker
Full Member
*
Offline



Posts: 11

Re: Data Agent
Reply #2 - Sep 6th, 2011, 4:41pm
 
Thanks!  Works great.
Back to top
 
 
  IP Logged
Michael Becker
Full Member
*
Offline



Posts: 11

Re: Data Agent
Reply #3 - Sep 6th, 2011, 4:52pm
 
BTW, one other question.  Can an agent like this return a result to the UI, e.g. "number of items returned in query."  If so, how would you write the express? How would it show up?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4107
Southsea, UK
Re: Data Agent
Reply #4 - Sep 6th, 2011, 6:44pm
 
The only way is via a DisplayExpression. For your agent, thenter this in the 'DisplayExpression' box of the Rename dialog:

$Name+"   ("$MyMonth+"/"+$MyYear+": +$ChildCount+" items)"

For agent "Emails" with attroibutes set for month 7 and year 2011, and with 6 matches, the $DisplayName will be:

Emails   (7/2011: 6 items)

See also $DisplayExpression and Display Expressions.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
Michael Becker
Full Member
*
Offline



Posts: 11

Re: Data Agent
Reply #5 - Sep 6th, 2011, 7:03pm
 
Perfect, thanks!
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print