Hi everyone,
I have an agent (Sheduled daily on all documents in database) in which the select statement is not working. When using the same statement in a view it works. In the agent, the select statement picks up everything including the documents that have the Status = “Cancelled”. In the view, the select statement picks up everything including the documents that have the Status != “Cancelled” as intented.
Can anyone tell me why this is behaving like this and how can I make the agent act on the appropriate documents as stipulated by the select statement.
ds:=DateMasterApproved;
today:=@Date(@Today);
st:=“Approved”;
SELECT Form =(“frmPO”) & MasterStatus=st & POOrderDate =“” & POConfirmDate =“” & ((today-ds)/86400>1) & Status != “Cancelled”;
divsel1:=@If(@Contains(Division;“Network Communications” : “Network” : “Telephony”); AuthorEMail : ServiceEMail ; AuthorEMail);
SendTo:=WhseMgr;
CopyTo:=“”;
BlindCopyTo:=“”;
Link:=“http://ccsnts1/po/fsmain!Open&Frame=fMid&Src=/ponumber/” + PONumber + “!Open&Login”;
Subject:=“5 - Confirm Order Placement: " + PONumber + " (” + Division + " - Job No " + GPJobNumber + “) has been Approved - add confirmation dates”;
newsub:=@If(PODesc=“”;Subject;“5 - Confirm Order Placement: " + PODesc + " has been Approved - add confirmation dates”);
REM “Send email to author and Service if division is Network or Telephony and if the POOrderDate is empty and PO not comfirmed yet and more than 1 day after approved. Otherwise only email to author”;
@MailSend(SendTo;CopyTo;BlindCopyTo;newsub;“”;@NewLine:“If the order has been placed please add the confirmation dates to the "Date PO Confirmed By Vendor" field in the Tracking grid” : @NewLine : "Follow the link to add confirmation details: ":Link);
REM “Advise SysAdmin of same”;
@MailSend(SendToSysAdmin ; “” ; BlindCopyTo ; newsub ; “” ; @NewLine:“If the order has been placed please add the confirmation dates to the "Date PO Confirmed By Vendor" field in the Tracking grid” : @NewLine : "Follow the link to add confirmation details: ":Link)