You need to use Events in ASPRunner 4.0. Events are desinged specifically for this purpose.
Ok thanks - So testing this out - the code is stored in: include/xxx_events.asp
eg)
<%
Sub AfterEdit()
'** Insert a record into another table ****
strSQLInsert = "INSERT INTO dbo.[Clsd_TS_Ticket_Referral] ([Service Record ID], [Project], [CSR], [Sims], [ServiceDate], [ProblemDescription], [Status], [Technician], [Tech Support], [Resolution Date], [Priority], [Severity], [Last Modified], [TechSuppRegion], [Technician1], [ExtraDetail]) VALUES ([Service Record ID], [Project], [CSR], [Sims], [ServiceDate], [ProblemDescription], [Status], [Technician], [Tech Support], [Resolution Date], [Priority], [Severity], [Last Modified], [TechSuppRegion], [Technician1], [ExtraDetail])"
dbConnection.Execute strSQLInsert
End Sub
%>
This is called in the edit page based on:
if RetVal = True then
rs.Update
' AfterEdit Event
DoEvent "Call AfterEdit()"
else
rs.CancelUpdate
end if
- I am assuming this code uses the exiting connection string defined in the other included file xxx_dbconnection.asp
- This is a test scenario leaving out any parameters thus using "values" instead if "select" "where" - I am assuming this should insert the current record being edited in the xxx_edit page...
I think I am missing something key as this code does not seem to get called at all...
Do you have some sample code you could share outlining the use of this cool feature?
As an aside I could do something similar with VBScript such as initiate an Outlook email message based on the onclick event of the save button but never had any luck calling an ASP "sub" or "function"... So for something like a totals calculation functions would be defined in jsfunctions.js such as:
function getLabourPartsTotal()
{
document.editform.LabourTotal.value = UpdateLabourTotal();
document.editform.PartsTotal.value = UpdatePartsTotal();
document.editform.GSTTotal.value = UpdateGSTTotals();
document.editform.PSTTotal.value = UpdatePSTTotals();
var var1;
var var2;
var var3;
var var4;
var1 = UpdateLabourTotal();
var2 = UpdatePartsTotal();
var3 = UpdateGSTTotals();
var4 = UpdatePSTTotals();
document.editform.Total.value = parseFloat(var1) + parseFloat(var2) + parseFloat(var3) + parseFloat(var4);
}
I think this product is amazing just a little confused on a couple issues...