This topic is locked

Mutiple URL MasterKey Values

10/19/2006 2:01:19 PM
ASPRunnerPro General questions
B
bleckron author

Here goes...
I have four tables all chained together. This is the flow...
Clients is the Master table
The child table for Clients is ICP based on the field SID in both tables
ICP is then the master table for the next table in the chain 'Goal' linked on two fileds SID and ICPDate
The table Goal is then the master table for the table ServiceActivities based on three fileds, SID, ICPDate and GoalNo.
The idea is that as the user picks a client and then picks an ICP and then a Goal and then a Service Activity that the list pages are narrowing as they go. However the list pages only filter on one filed and I need to filter on multiple fileds. How do I do htis?
Brad <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=3628&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />

J
Jane 10/20/2006

Brad,
unfortunately, you can't use complex foreign keys in ASPRunner.
But here is a workaround:

  1. set Clients as the Master table.

    Set ICP as the child table for Clients, use SID field as foreign key for ICP table.

    Set Goal as child table for ICP, use ICPDate as a foreing key for Goal table.

    Set ServiceActivities as child table for Goa table, use GoalNo as a foreign key for ServiceActivities table.
  2. proceed to the Events tab, select BeforeAdd event and add your code in the.

    Here is a sample code for the Goal table:
    Function BeforeAdd(dict)

    dict("SID") = SESSION("Goal_masterkey1")
    BeforeAdd = True
    End Function



And sample code for the ServiceActivities table:

Function BeforeAdd(dict)

dict("ICPDate") = SESSION("ICP_masterkey1")

dict("SID") = SESSION("Goal_masterkey1")
BeforeAdd = True
End Function


3. use SESSION("Goal_masterkey1") as default value on the "Edit as" settings dialog for the SID field of the Goal table and SESSION("Goal_masterkey1") and SESSION("ICP_masterkey1") as default values for the SID and ICPDate fields of ServiceActivities table correspondingly.

B
bleckron author 10/20/2006

Jane:
Thanks for your help. I tried the work around you suggested but with the same results. When I go from CLIENTS_list.asp to ICP_list.asp all is well. When I click on 'Goal' in ICP-list.asp and go to the Goal_list.asp page it is listing more that it should. It doesn't seem to be filtering on SID and ICPDate as we hoped, but only the ICPDate. Correspondingly, on the ServiceActivities_list.asp page it does not seem to be filtering on SID and ICPDate, only GoalNo. Do I need to place the custom code in a different, or multiple, event(s)? Could we call the session variables directly in the ASP code and then reference them simillarly? I appreciate your help, I get this working and I think we got it!
Brad <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11981&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

Brad,

unfortunately, you can't use complex foreign keys in ASPRunner.
But here is a workaround:

  1. set Clients as the Master table.

    Set ICP as the child table for Clients, use SID field as foreign key for ICP table.

    Set Goal as child table for ICP, use ICPDate as a foreing key for Goal table.

    Set ServiceActivities as child table for Goa table, use GoalNo as a foreign key for ServiceActivities table.
  2. proceed to the Events tab, select BeforeAdd event and add your code in the.

    Here is a sample code for the Goal table:
    And sample code for the ServiceActivities table:
  3. use SESSION("Goal_masterkey1") as default value on the "Edit as" settings dialog for the SID field of the Goal table and SESSION("Goal_masterkey1") and SESSION("ICP_masterkey1") as default values for the SID and ICPDate fields of ServiceActivities table correspondingly.