04-27-2017 05:57 AM
Hi there,
I have a rule on a folder that executes some custom javascript.
The rule is triggered:
"When items are created or enter this folder"
and
"When items are updated"
I want my script to behave slightly differently for each event.
Does anyone know if it is possible to detect which event triggered the script or do I need to create 2 separate rules and scripts?
Thanks
Paul
04-27-2017 07:56 AM
Hi Paul,
I don't think there is a handle or something else for the triggering event, but you can set/check a special property on the triggering object. For example a document action triggers the event,
you could also check the modified an created date time - if modified is newer than created, it was a update/change event. (if created is newer than modified, shut down your whole network )
Maybe thats more work than to handle two separate events... but...
regards,
Martin
04-27-2017 09:16 AM
Or another option would be to use behaviors instead, and then you will be able to detect what caused the execution, and even more details like, the properties that got changed, including the before and after values.
05-02-2017 10:19 AM
Thanks Douglas
05-02-2017 10:18 AM
Thanks Martin
Explore our Alfresco products with the links below. Use labels to filter content by product module.