This topic is locked

Display Message on Page Before being redirected to the list page

2/22/2011 2:45:02 AM
ASPRunnerPro General questions
W
Wallaroo author

Hi
I am wondering is someone can help. I have a project where an Access Query is being used as an update table where values are filtered i.e. FieldName = Approval_Status Value = Pending. After the page is edited by a user and the Approval_Status value changed, the record disappears from the list page as it has changed. This is all ok.
However, what I am trying to do is this:-
User chooses a records from the list page to edit.

User changes Approval_Status value and submits.

An email is sent as per designated fields

However, a message is not displaying on the edit page of "An email has been sent to the employee" before it redirects to the list page.
All is working OK except for the message on the web page. Any ideas how I can make this work so that the message displays on the edit page after the email has been sent but before the page redirects to the list page? Here is the code that I am using for this snipet -
Dim dkeys, tmpDict, msg, n

msg ="This is an auto generated email to advise of your HDA Application status." & vbcrlf

msg = msg & "" & vbcrlf

msg = msg & "ID: " & dict("HDA_Record_ID")& vbcrlf

msg = msg & "Name: " & dict("Employee_Name")& vbcrlf

msg = msg & "Staff No: " & dict("Employee_No")& vbcrlf

msg = msg & "Port: " & dict("Port")& vbcrlf

msg = msg & "Manager Email: " & dict("Manager_Email")& vbcrlf

msg = msg & "Allowance Type: " & dict("Allowance_Type")& vbcrlf

msg = msg & "HDA Start Date: " &format_shortdate(db2time(dict("HDA_Start_Date"))) & vbcrlf

msg = msg & "HDA End Date: " &format_shortdate(db2time(dict("HDA_End_Date"))) & vbcrlf

msg = msg & "Higher Duties Grade From: " & dict("Higher_Duties_From")& vbcrlf

msg = msg & "Higher Duties Grade To: " & dict("Higher_Duties_To")& vbcrlf

msg = msg & "Relieving Employee: " & dict("Relieving")& vbcrlf

msg = msg & "Relieved Employee's Staff No: " & dict("Relieved_Employees_No")& vbcrlf

msg = msg & "Approval Status: " & dict("Approval_Status")& vbcrlf

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

msg = msg & "Approved/Reviewed Date: " &format_shortdate(db2time(dict("Approval_Date")))& vbcrlf

msg = msg & "Comments: " & dict("Comments")& vbcrlf

msg = msg & "" & vbcrlf

msg = msg & "Should you have any queries regarding this email, please direct them to your Manager - " & dict("Manager_Email") & vbcrlf
if values("Approval_Status")= "Approved" then

set tmpDict = CreateObject("Scripting.Dictionary")

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

tmpDict("cc")=dict("Email_Approval_To_1")

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

tmpDict("subject")="HDA APPLICATION APPROVED - " & dict("Employee_Name")

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

message="An email has been sent to the Employee & Payroll"
ElseIf values("Approval_Status")= "Declined" then

set tmpDict = CreateObject("Scripting.Dictionary")

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

tmpDict("subject")="HDA APPLICATION DECLINED - " & dict("Employee_Name")

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
Any help would be appreciated!

Sergey Kornilov admin 2/22/2011

You cannot display a message before redirect. There is no delay before user is redirected and your message won't be seen.
As a workaround you can add a link to the list page right to the message and remove the redirect. In this case user can read the message and click a link to continue to the list page.

W
Wallaroo author 2/22/2011



You cannot display a message before redirect. There is no delay before user is redirected and your message won't be seen.
As a workaround you can add a link to the list page right to the message and remove the redirect. In this case user can read the message and click a link to continue to the list page.


Thanks Sergey, I will try the workaround. Under which file would I find the redirect information?

Sergey Kornilov admin 2/22/2011

I assumed there is a redirect in your event code. If this not the case post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.
Need to see how it works to fully understand that.

D
Dixie 2/27/2011

I use this code to display messages on event page (I am new to this, so if it doesn't work, forgive me).
This is just javascript and it seems to work fine for me and although I am still using the eval version, I suspect it should work.
Hope it helps. Note the placement of the ASP tages... and put a response.end in the script.
rtnPage = "/VirtualDir/PAGE_TO_GO_TO.asp"

%>

<script type='text/javascript'>

alert('<% = strMSG %>');

location.href = '<% = rtnPage %>';

</script>

<%