I have a component performing SQL operations on a database.
At end of each function I set a REQUEST.msg which informs the user that the operation was a success and passes the ID number. The user is returned to the search form in Search or Edit mode. This works great for
Insert, select, and update but fails to persist for Delete function. The REQUEST.msg is not updated.
Example:
<cffunction name=“deleteRecord”
<cfquery>delte sql here </cfquery>
<cfset REQUEST.msg = “Record Deleted ID= this.id”>
</cffunction>
The only real difference in calling the function is that I am using “insert type=button onClick=…” to pass the id to the delete function vs using the submit button on the form. After the Delete operation I return the user to the search form using CFLocation.
Should I be using a SESSION variable rather than the REQUEST scope, or other scope variable?