Accordion folds are described on the page Adding Accordion Folds to Layouts. You may use rules to set the initial state of an accordion fold to be open or closed, and you may open or close folds using rules to determine the state of the fold..
Examples
-
You have created two folds within the data dictionary, named Fold A and Fold B. This implies the fields named
FOLD_PRE_A
,FOLD_POST_A
,FOLD_PRE_B
andFOLD_POST_B
all exist - You have placed these fields onto an add, edit or embedded layout
- The default behavior is that both folds are initialized in a closed state
-
The first example shows how you might use a load directive to open Fold A when the screen is first presented to the user
<== load ==>
FOLD_PRE_A = {open};
-
At the point where the user has opened Fold A and has performed data entry within there, we want Fold B to open when they click on the fold, and we want Fold A to close
<== onchange ==>
if (FOLD_PRE_B.{changed to:{open}}) {
FOLD_PRE_A = {closed};
}
-
Whenever we click on Fold B, and no matter its state, we open another fold
<== onchange ==>
if (FOLD_PRE_B.{changed}) {
FOLD_PRE_A = {open};
}
-
In this case, we have a more complex
if
statement, and we both open and close other folds when we open Fold B. This example also presumes the existence of FOLD_PRE_C andFOLD_POST_C
<== onchange ==>
if (FOLD_PRE_B.{changed to:{open}} && STATUS = 'Fixed') {
FOLD_PRE_A = {closed};
FOLD_PRE_C = {open};
}
-
This last example shows how you might preset a number of folds, based upon the value of another field being changed by the user
<== onchange ==>
if (STATUS.{changed}) {
FOLD_PRE_A = {open};
FOLD_PRE_B = {open};
FOLD_PRE_C = {closed};
}