Child Form Override Links
Child Form Override Links allow you to override the default behavior of the Add, Edit and Goto links that appear on child form rows.
By default, these buttons will always go to the Destination Form specified in the child form, or the Goto Override Form if one is specified. Sometimes, however, you may require these links to go to different Destination Forms than the default one. For example, you may have one form for adding a new record and a different form for editing and/or going to an existing record. Child Form Override Links allow you to do this.
Even beyond that, child form override links can also be applied conditionally on each row of the child form. For example, child form rows relating to a Payment may go to a Payment destination form, and child form rows relating to a Refund may go to a Refund destination form.
Adding Records
Child form override links are added from the Child Form on the override links child form. For override links to work, the has override links checkbox on the Child Form must be checked.
Managing Records
The following controls are entered on override links:
Child Form: The child form on which the override link will apply.
Apply to: The link to override. May be Add, Edit, Goto, or Goto and Edit (both).
Destination Form: The form you want the link to go to (instead of the default Destination Form of the child form). If the link is for a Goto or a Goto and Edit, then the destination form will override the default Goto Form (if any) of the child form.
Wizard: The Wizard you want the override link to go to. If you would like to override link to go to a Wizard, you must also select a Destination Form as well. The override link will still go to the Wizard, but you must also specify a Form; generally you should choose the same Form as the destination form on the child form.
Key Column: The key column of the Destination Form. This will override the default key column entered of the child form. This field is required unless Apply To is Add.
Static Form: If you need to pass parameters to the form that opens up, you can do so in this field. Preface the parameters you want to pass with the & character, for example, &a99_code=New. More rarely, you may enter the file name of a static edit form is the dynamic edit form is not to be used. The file name of a static form to override the destination form of the child form. Rarely if ever used.
Control/Value combinations: The Control/Value entries are used together as conditions for whether or not to active the override link. If you do not have any Control/Value combinations, then the child form override link will always be activated.
If a Control/Value combination is entered, then the override link will active only if:
Control 1 == Value 1
Generally, you will only need to work with, at most, Control 1 and Value 1 in order to have different forms get applied for different types of data.
In rare advanced cases, you could evaluate additional two or more conditions. If you enter something in Control 2 and Value 2 as well as in Control 1 and Value 1, then netFORUM will apply the override link only if both sets (Control/Value 1 and Control/Value 2) are true. Each additional Control/Value (2, 3 and 4) must evaluate to true to make the override link apply to the particular scenario.
Case Study
Following is an example. Observe the following profile form and its grandchild form:
Note the grandchild form with two records. The first row is for a Refund and the second row is for a Payment. We want the first Goto link to go to the Refund form and the second Goto link to go to a Payment form. Note that the end user cannot visually see that the two Goto links are wired to go to different destination forms.
With a standard child form, there is no way to have the Goto link go to different destination forms in different circumstances. We need to have two child form override links to accomplish this. One override link will fire when the Used For value of the child form row is Refund and the other will fire when the Used For value is Payment.
Before creating override links, we must first ensure that the child form has the Allow Goto checkbox checked and has the has override links checkbox checked. Since we have override links, it is not necessary to enter a goto form or a goto key column; if the child form override link conditions are not met, then the default behavior of the goto link will be applied.
Next, from the child form definition, we add two child form override links.
The first override link will direct the Goto link to the Process Payments form:
This override link will activate only when the value of control 1 is equal to the value in value 1. In this case, it will activate only when:
[Used For] == 'Payment'
When this condition is met, as it is in the first child form row (the row for Refund and Transaction Code 10559) then the Goto link will go to the Process Payments form using the key column of pay_key to find the correct record.
The second override link will direct the Goto link to the Refund form:
This override link will activate only when:
[Used For] == 'Refund'
When this condition is met, then the Goto link will go to the Refund form using the ref_key as the goto key column.
For both child form override links illustrated above, the key column values (pay_key and ref_key) must be selected in the child form select sql or else netFORUM will be unable to create the link. Also, note how we define the value of [Used For] in the SQL:
Advanced Scenario
Note that if none of the child form override link(s) satisfy the control/value combination(s) defined for them, then the default link behavior for the child form will be activated. This is essentially what would have happened if there were no child form override links at all for that child form.
For example, you have a child form displaying records that are active or inactive according to some criteria. You may want to manage active records with the default destination form, but drive inactive records to a different child form.
In this case, you would have one child form destination link with apply to Goto and Edit. The destination form would be whatever your inactive form is and the key column would be whatever is the primary key for that record. Your control1/value1 combination would be xxx_inactive_flag and 1 (or however else you define active and inactive status).
When the child form renders, the Edit and Goto hyperlinks will be the default destination form (or Goto form if applicable) of your child form unless the row has (xxx_inactive_flag==1) in which case the destination form will be your inactive form.