Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
OnAdd for containers (Read 2067 times)
Alex Strick van Linschoten
Full Member
*
Offline



Posts: 61
Holland
OnAdd for containers
Jun 27th, 2014, 4:29am
 
Just wondering where I find somewhere to write some "onadd" commands.

Use scenario: I want to assign a prototype to notes when I add them to a certain container.

Can someone point me to the place where I can add this?
Back to top
 
 
WWW strickvl   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: OnAdd for containers
Reply #1 - Jun 27th, 2014, 5:05am
 
$OnAdd works as before. Instead of using the v5 Create/Rename dialog, go to the v6 Actions Inspector and click the 'Action' tab. If the selected item is an agent, you will get setting $AgentAction. For anything else as the selection - note, adornment, etc. - you will be setting the $OnAdd.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Alex Strick van Linschoten
Full Member
*
Offline



Posts: 61
Holland
Re: OnAdd for containers
Reply #2 - Jun 27th, 2014, 5:42am
 
Perfect. Thanks, Mark!

Followup Q: Is it possible to set a variable $StartDate from that on-add command tool? I want it to set the date to "now" or (worst case) just "today" (which is the same thing, in my understanding).

I know it works if I give it static dates to assign, but does it work with those dates which are then converted later on?
Back to top
 
 
WWW strickvl   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: OnAdd for containers
Reply #3 - Jun 27th, 2014, 6:38am
 
Try this in your $OnAdd (tested in v6.0.1):

$StartDate = date("now")

Using date() with a string literal date, e.g. "now" makes it clearer to TB that you're using Date-type data.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Alex Strick van Linschoten
Full Member
*
Offline



Posts: 61
Holland
Re: OnAdd for containers
Reply #4 - Jun 27th, 2014, 6:44am
 
Works a treat. Thanks!
Back to top
 
 
WWW strickvl   IP Logged
Pages: 1
Send Topic Print