A
|
ann 7/23/2010 |
Hi, if values("Status")= "Approved" then |
W
|
Wallaroo author 7/23/2010 |
Thanks Ann -that worked a treat! Now following on from that, can you help me with this query? how would I send an email to one addressee if the value = "A", but send it to two different addressees if value ="B". Here is my current code:- if values("LeaveApproved")= "Approved" then Dim dkeys, tmpDict, msg, n msg ="This is an auto generated email to advise of your Leave Application status." & vbcrlf msg = msg & "" & vbcrlf msg = msg & "ID: " & dict("ID")& vbcrlf msg = msg & "Name: " & dict("Name")& vbcrlf msg = msg & "Staff No: " & dict("StaffNo")& vbcrlf msg = msg & "Port: " & dict("Port")& vbcrlf msg = msg & "Leave Start Date: " &format_shortdate(db2time(dict("LeaveStartDate"))) & vbcrlf msg = msg & "Leave End Date: " &format_shortdate(db2time(dict("LeaveEndDate"))) & vbcrlf msg = msg & "Leave Type: " & dict("LeaveType")& vbcrlf msg = msg & "Leave Status: " & dict("LeaveApproved")& vbcrlf msg = msg & "Approved By: " & dict("ApprovedBy")& vbcrlf msg = msg & "Approved Date: " &format_shortdate(db2time(dict("ApprovedDate")))& vbcrlf msg = msg & "" & vbcrlf msg = msg & "Should you have any queries regarding this email, please direct them to your Manager." set tmpDict = CreateObject("Scripting.Dictionary") tmpDict("to")=dict("Email") tmpDict("cc")=dict("ManagerEmail") tmpDict("subject")="LEAVE APPLICATION STATUS" tmpDict("body")=msg set ret=runner_mail(tmpDict) if not ret("mailed") then response.write ret("message") end if end if This works fine, but I now want to amend the code so that the email addressee shown as "CC" does notget an email if the value in the field "LeaveApproved" = "Declined". Many Thanks use After record updated event on the Events tab and predefined action Save email with new data (Add action button on the Events tab). Here is a sample: if values("Status")= "Approved" then |
A
|
ann 7/26/2010 |
Hi, if values("LeaveApproved")= "Declined" then |