Trigger an event

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 8, 2011   (RSS)

By andycal - August 7, 2011

Here's a technical question for you experts!

I'm looking to amend one of the editors I've created so that if someone changes the status of one of the fields it triggers an event.

The even will be a PHP function, probably send an email or something, I'm OK with that bit. It's triggering it that's the thing.

So, for example, someone edits a record and changes the 'status' to 'live' - is it possible to edit the page somehow so I can trap the status and send it to the function?

I'm not after chapter and verse, I'm really just after a pointer as to where to look in the code and whether there's already something there I can hook in to?

Re: [andycal] Trigger an event

By Jason - August 8, 2011

Hi,

You can do this without having to edit any CMS Builder code. What you can do is create a custom plugin for yourself that will be triggered when a record is saved. We have a number of different "hooks" in the software that allow you to write custom functions in plugins when certain actions take place. If you are using CMSB version 2.09 or above, you can see a list of all the hooks in the software from the plugins page.

For your purposes, it looks like you would want to use the hook record_postsave, which is triggered after any record is saved inside CMSB. Take a look at this post for a quick overview on how to get started on your plugin:

http://www.interactivetools.com/forum/gforum.cgi?post=89203#89203

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/