View Single Post
  #6 (permalink)  
Old August 25th, 2008, 06:42
james_foran james_foran is offline
Member
 
Join Date: Dec 2007
Posts: 72
Groans: 1
Groaned at 1 Time in 1 Post
Thanks: 5
Thanked 12 Times in 12 Posts
Rep Power: 2
james_foran is on a distinguished road
Re: Customizing the Notifications?

I have written a series of Saved Queries (SQL Scripts) that execute, and then included these in an agent as IF Conditions.

EG, IF Servprov does Match, would end up something like...

SELECT i.invoice_gid
FROM invoice i,
invoice_refnum ir,
shipment_refnum sr,
shipment s,
servprov_alias sp
WHERE i.invoice_gid = ir.invoice_gid
AND ir.invoice_refnum_value = sr.shipment_refnum_value
AND sr.shipment_gid = s.shipment_gid
AND sp.servprov_gid = s.servprov_gid
AND sp.servprov_alias_qual_gid = i.servprov_alias_qual_gid
AND ir.invoice_refnum_qual_gid = 'BM'
AND sr.shipment_refnum_qual_gid = 'BM'
AND sp.alias = i.servprov_alias_value
AND ir.invoice_gid = $gid


If this returns no record, then you know that the servprov is not correct. YOu first have to check that the Shipment exists though. The sequence is fairly important.

Hope this helps.
__________________
James Foran
Toll Solutions
http://www.tollgroup.com
Reply With Quote