This topic is locked

Update field Value to text in Master record

8/10/2009 10:55:30 AM
ASPRunnerPro General questions
D
deeg author

Let me preface this by saying I am a NOVICE at programming in ASP
Two tables:
Stockroom Request
Request Detail

  1. I want to add a new STOCKROOM REQUEST, and after ADDING the record, REDIRECT user to the list view of the detail/child page showing the master record. Primary Key is REQUEST_ID. I don't want to use an add page for the child record, only inline add.
  2. After adding request detail and saving all, I want to update the Master table status field to a different value. FOr example, default STATUS for Master record is "1" but after one or more child records are added, it should change to a "2".
    This is important because the plan is to add multiple views filtering by Status.
    Any assistance you can provide would be appreciated. This project is a test to determine the viability of using ASP Runner statewide. Thank you.

C
clig 8/10/2009

Let me preface this by saying I am a NOVICE at programming in ASP

Two tables:
Stockroom Request
Request Detail

  1. I want to add a new STOCKROOM REQUEST, and after ADDING the record, REDIRECT user to the list view of the detail/child page showing the master record. Primary Key is REQUEST_ID. I don't want to use an add page for the child record, only inline add.
  2. After adding request detail and saving all, I want to update the Master table status field to a different value. FOr example, default STATUS for Master record is "1" but after one or more child records are added, it should change to a "2".
    This is important because the plan is to add multiple views filtering by Status.
    Any assistance you can provide would be appreciated. This project is a test to determine the viability of using ASP Runner statewide. Thank you.


In the inline edit page you could do a "After record updated" event
sample based on a text value of a field:

  • NTSS_Tickets table is the parent - a new record was added to the NTSS_Actions_Me child with a value "Private" in the field "Action_Item" - updates "Modified" field in parent - then redirects to the parent child view
    If dict("Action_Item") = "Private" Then

    strSQLInsert = "UPDATE [NTSS_Tickets] SET Modified = " & "'" & SESSION("Updated") & "'" & " WHERE [TicketNo] = " & Session(strTableName &"_masterkey1")

    dbConnection.Execute strSQLInsert

    Response.Redirect "NTSS_Actions_Me_list.asp?mastertable=dbo%2ENTSS%5FTickets%5FMe&masterkey1=" & Session(strTableName &"_masterkey1")

    Else

    Response.Redirect "dbo_NTSS_Tickets_Me_list.asp"

    End If