devxlogo

Event for Posting New Items to a Folder

Question:
I have been asked to write a script that will send an e-mail to a distribution list if a new item is placed in a public folder. I have two questions:

  1. Will the posting of a file (.xls, .doc, etc.) in a public folder trigger the new item posted event just like a new message would?
  2. If a posted file is opened, changed, and then saved, will the message changed event get triggered?

Answer:
If you use the OnMessageCreated event, any new item posted to the folder (message, document, or whatever) will trigger the script, and opening, changing, and resaving an existing item in the folder will not trigger the script.

If you want to fire on changed items, use the OnChanged event for the folder.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.