| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > WindowManager > WindowManager Methods >====== AddHistoryField (add restorable control and field) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[windowmanager functional organization expected use.htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[addhistoryfile add restorable history file .htm|{{btn_next_n.gif|Next page}}]] | | || **AddHistoryField( **//control, field// **)** {{blk2blue.jpg|blk2blue.jpg}} | **AddHistoryField** | Adds a history field to the WindowManager object. | | //control// | An integer constant, variable, EQUATE, or expression containing the control number of the control whose contents to restore from the //field//. This is the field equate number of the control. | | //field// | An integer constant, variable, EQUATE, or expression containing the position of the field within the history file's record layout. The field is identified by its position in the FILE declaration. A value of one (1) indicates the first field, two (2) indicates the second field, etc. See [[what return field from group .htm|WHAT]]// //and [[where return field position in group .htm|WHERE]]// //in the //Language Reference// for more information. | The **AddHistoryField **method adds a history field to the WindowManager object. AddHistoryField associates a window control with its corresponding database field or column, so the WindowManager can restore the control's contents when the end user invokes the history key (or FrameBrowseControl ditto button). **Implementation:** The AddHistoryFile method names the file and record buffers from which fields are saved and restored. The AddHistoryField method associates specific fields from the history file with their corresponding WINDOW controls. The SaveHistory method saves a copy of the history fields. The RestoreField method restores the contents of a specific control. **Example:** **ThisWindow.Init PROCEDURE()** **  CODE** ** !procedure code** **  SELF.HistoryKey = CtrlR** **  SELF.AddHistoryFile(CLI:Record,History::CLI:Record)** **  SELF.AddHistoryField(?CLI:Name,2)** **  SELF.AddHistoryField(?CLI:StateCode,3)** **See Also:**     [[addhistoryfile add restorable history file .htm|AddHistoryFile]], [[historykey restore field key .htm|HistoryKey]], [[restorefield restore field to last saved value .htm|RestoreField]], [[savehistory save history fields for later restoration .htm|SaveHistory]]