This topic is locked

Cannot get alert to work on 6.1

7/31/2009 11:41:26 AM
ASPRunnerPro General questions
R
rgke author

I am evaluating ASPRUNNER 6.1, and have done a trial upgrade of a project originally created in version 4.0.
Everything appears to work perfectly except for an alert which is designed to tell the user the project ref created when a record is inserted into the database. (For various reasons, this project ref is created in the SQL database using triggers, so the code has to retrieve the code from the last record written (ok given the general rate at which records are written).
This all works ok in version 4.0 but although I know that the function is being called an executed, the alert does not pop up. This is the code I have in th function AFTERADD:
str = "select max(ProjKeyMain) as mx from dbo.B001WIPList"

Set rsTemp = server.CreateObject("ADODB.Recordset")

rsTemp.open str, dbConnection
%><script type='text/javascript'>

alert("you added a new record with project number = <%=rsTemp("mx")%>");

</script>

<%
Any ideas on why this does not work in version 6.1?

J
Jane 8/3/2009

Try to use this one:

flush_output

Response.Write "<script>alert('you added a new record with project number = " & rsTemp("mx") & "');</script>"

R
rgke author 8/3/2009

Try to use this one:



OK, it appears the flush_output command (whatever that does!) makes the original code work, as well as the new.
Thanks. By the way, having paid for the licence, I raised this as a support ticket too so you have now sorted it.