This topic is locked

Message on screen after record update

11/9/2010 9:55:26 PM
ASPRunnerPro General questions
W
Wallaroo author

I have an event that, once a record is updated, a message appears on the screen like "An email has been sent to the employee".
However as the table is based on a query that will only display records with a status of "Not Approved". This means that once a record's status is changed in the edit screen to "Approved", "Declined" or "Waitlist", it will be removed from the list page. This all happens so quick that the message that is supposed to appear on the screen doesn't. I have copied the relevant code below. Is there any way of changing this so that the message appears before the screen reverts back to the List page?
' After record updated

Function AfterEdit(ByRef values,where,ByRef oldvalues,ByRef keys,inline)
Dim dict

Set dict = values

'** Send email with new data ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog

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 & "Comments: " & dict("Comments")& vbcrlf

msg = msg & "Approved/Reviewed By: " & dict("ApprovedBy")& vbcrlf

msg = msg & "Approved/Reviewed 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 - " & dict("ManagerEmail") & vbcrlf
if values("LeaveApproved")= "Approved" then

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=dict("Email")

tmpDict("cc")=dict("ResourcePlanner1")

tmpDict("cc")= tmpDict("cc") & ";" & dict("ResourcePlanner2")

tmpDict("subject")="LEAVE APPLICATION STATUS"

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

message="An email has been sent to the Employee & Resource Planner/s"
ElseIf values("LeaveApproved")= "Declined" then

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=dict("Email")

tmpDict("subject")="LEAVE APPLICATION STATUS"

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

message="An email has been sent to the Employee"
ElseIf values("LeaveApproved")= "Waitlist" then

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=dict("Email")

tmpDict("subject")="LEAVE APPLICATION STATUS"

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

message="An email has been sent to the Employee"
if not ret("mailed") then

response.write ret("message")
end if

end if
End Function ' AfterEdit

arrEventTables("AfterEdit")="FormSubmissionsS2SL"

arrAvailableEvents("AfterEdit")=true

Sergey Kornilov admin 11/11/2010

I'm not sure I fully understand this.
Are you talking about regular or inline edit?
It would be nice if you posted your app to demo account and shared the link. You can also send the link directly to support if your data are confidential.

W
Wallaroo author 11/15/2010



I'm not sure I fully understand this.
Are you talking about regular or inline edit?
It would be nice if you posted your app to demo account and shared the link. You can also send the link directly to support if your data are confidential.


Sergey, This applies to regular edit page and not inline edit. The info is confidential so perhaps I can send you a link?

Sergey Kornilov admin 11/15/2010

I would suggest to create a copy of this project removing all confidential data and upload it to Demo Account. Then contact support sending Demo Account URL along with error description.