Forum Discussion

RandyRandy's avatar
RandyRandy
Qrew Member
10 years ago

send notification when condition is met only on first instance

I have a summary field that is totaling dollars spent in individual records. I also have a budget for the project. I would like to send an e-mail notification when the first record cause the total to exceed budget and then I'd like the notification to stop sending.


For example.  Budget is $100

record 1 expense $65  (no notification sent)

record 2 expense $50 (Email sent because job is $15 over budget)

record 3 expense $10 (no notification sent because e-mail was already sent after record 2 was created)

  • Sounds like you have (at least) two tables, "Project" records, and then the child table which contains these "Expense" records. The budget is dictated on the Parent Table, and each of the Expense records is added as a child to that "project" Am I on the right track so far?

    I would create a Summary field on the Parent table that shows the Total $ amount of all of the Expenses (maybe you already have this?). Now on that Parent table you have the Total Budget and the Total expenses on the same record, so we're getting a little closer. Create a formula field to compare the two to see if it is greater or less than 0.


    Now that you have that "variance" field, or whatever you'd like to call it, Create a Lookup field of that number to pass that down to the child records. Now each Child has a sense of whether the Parent record is above or below budget.

    So maybe you even already have a lot of this. A next step will be to create a formula checkbox that evaluates whether the project is at the budget yet, and checks itself when the project has hit its budget. This field could be hidden from your forms so it can just run in the background.

    Now back to your notification. You can set your notification to send when that Checkbox is checked. It will only check itself when the project passes the budget for the first time, so additional expenses don't trigger this notification.



    Does this make sense, and does it work? Are there any questions on parts of it that might not be clear or might have missed the mark on?
  • You are on the same page in all areas. And the process you've mentioned is the exact process I've followed. The problem is after budget is exceeded each new record created triggers a new notification

    I want this notification to be sent with each new record created  to my purchasing team and estimators so they can continue to monitor the issue. However as the next level up I only want one e-mail knowing job had an issue. Currently I am receiving 10-15 emails per job for being over budget at times and I only want one.  

    So I want one notification that always sends email when a record is created  and budget is exceeded. I want another notification that sends email only after initial record that is created has caused job to exceed budget. It's the second notification I'm having issues with.
  • Btw, I thought it was as simple as the formula checkbox, but when a new record in child table is created since it is a lookup field it always triggers the change because it is as if all fields in the record were empty and upon saving they all fill in. So the check box technically always goes from unchecked to checked and thus fires the notification.
  • Maybe add a form rule to say

    When the record is saved
    and
    Project is over budget (this would be some kind of formula checkbox field done as a lookup from the Parent Project record.

    Change the manual checkbox field called  [Project is now over budget (manual checkbox)] to checked.

    Then do not fire the Notification once that box is checked.

    You will need to test if this will catch it in time.  It's possible that the email will not fire until the second expense over budget comes in.  I have not tested that.
  • I'm so sorry to dig this up from 2 years ago, but I have a similar business need. We have a date field that changes all the time, but we only want people to get notified of the first initial change. Did the checkbox solution work for you? The logic is somehow not making sense to me. 

    Ideally, if [Date.old] is blank and [Date] is not blank, send a notification. If [Date.old] is not blank and [Date] is not blank (meaning there was already a date entered), don't send a notification.

    How it should be is,
    1. Record has a blank date
    2. Date is added to the record, notification is sent
    3. Date is changed on the record, notification is not sent
    The suggested solution is,
    1. Record has a blank date
    2. Date is added to the record, notification is sent, box is checked upon record save
    3. Date is changed on the record, notification is not sent if the box is checked
    However, in step 2, saving the record with the added date will also check the box, so the notification wouldn't go out, anyway, because the box is checked as soon as it's saved, right?

    The only workaround I can think of is to have a manual checkbox that people will have to check if they do not want notifications to be sent.