I created a Data Directive for the ShipHead table, that creates an email notice when a packer is shipped, or the tracking # of a shipped packer is changed.
Been working fine for a while, but now seems to be kicking of an email when the tracking# changes prior to shipment.
ShipStatus changes to SHIPPED
OR
(Tracking# changes AND (ShipStatus is "Shipped" OR ShipStatus is "Closed" ))
Yet it still kicks off an email when the Tracking# is changed prior to shipment.
I think this bug has always existed, but never seen before because the Tracking number was usually added after it was SHIPPED. Now it’s being entered (ie changed from nothing to something) during Packer creation.
Conditions can be tricky, I setup message boxes to display when developing them so I know which way the logic goes. The “updated/change/etc row” clause is sometimes not as intuitive as it seems I’ve had to play with those until I got it working right.
Also, consider splitting up the clause into two. That sometimes helps me get it working when I run into a wall like this.
packer notices that the tracking # is wrong and changes it… second Or condition met… email fires!
later the pack is marked shipped … first condition met … email fires again!
Also, if the packer enters the tracking number when the status is open and then closes instead of saves, that would trigger and email too… because I think when Closed is selected that calls Update… trace it again?
So why do you want an email to be sent if the pack is ‘CLOSED’ wouldn’t you just want it when it’s ‘SHIPPED’?
I might try splitting this into 2 separate data directives on ShipHead.
And then really spell out the conditions for the Tracking number change…
I suspect it is the one that is sending out your rogue emails.
1,ShipStatus directive
1.Conditions
c.1) At least one updated row in ttShipHead
c.2) ttShipHead.ShipStatus has changed from any top “SHIPPED”
Action… send email
2.TrackingNumber
2.Conditions
c.1) ___ ( At least one updated row in ttShipHead
c.2) AND ttShipHead.TrackingNumber has changed from any to another
c.3) AND ttShipHead.ShipStatus of all rows = “SHIPPED” )
c.4) OR ( At least one updated row in ttShipHead
c.5) AND ttShipHead.TrackingNumber has changed from any to another
c.6) AND ttShipHead.ShipStatus of all rows = “CLOSED” )