1

I have a list with multiple views, and for each view, I've added a total sum for a $ column. I want to be able to send out an email alert when that sum comes within 80% of it's allowed maximum value, or when it hits an expiration date.

Is there a way to do this?

3

For the sum total you might be able to use a SharePoint Designer workflow to achieve this. Essentially like this:

  1. When item is created or modified
  2. Run a loop on items that fall under a particular view (e.g. Category=A, Category=B, etc.)
  3. Keep a running total
  4. If that total exceeds your pre-defined value (hard coded or pulled from another list perhaps), send an email.

For the expiration alert, you can setup a policy that triggers a different workflow when a certain date has been reached. This is not the same workflow as previous, it would just send an email when triggered. Look under List settings > Information Management Policy Settings > Select Content Type > Enable Retention > Add Stage > You'll see the date setting and workflow configuration here.

Note that this Retention Policy workflow triggers based on an SPTimer job that runs periodically, I forget the exact name but by default I believe it's set to only run once per week, which means you need to change this to once per day or it will miss things.

Another option for both of these notifications is to write your own timer service that uses the API to query the list, perform the necessary calculations, and takes whatever action is needed. This is obviously a "coded" solution, compared to the previous two "no code" solutions. With this, you get significantly more control over when alerts are triggered, how the calculation is performed, error handling and retry, any additional actions you may want to take as a result (e.g. legacy/in-house system writes) etc.

1

For completeness: SPItemEventReceivers are the other option. (Workflows being the first, see the answer above.)

ItemUpdating and ItemUpdated events are possible. However, I'd also suggest a workflow - probably easier to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.