In this section:
When you click Finish in the Update Assist (Step 4 of 4) - Summary dialog box, the files that comprise your Update Assist project are generated. For a list of files, see Files Generated By Update Assist.
If you wish, you can perform further editing on these files.
These variables and the values you wish to set for them can be added to the area of code inside the MasterFileName_navbar.htm file that generates the tree, using the syntax
prior to the maintainTree.init() code.
var maintainTree = new maintainTreeInfo(constructFields(),mCallBack); linestyle = "white"; maintainTree.maxNodesPerFolder= 8; maintainTree.maxFolders = 20; maintainTree.init();
Note: If the maxNodesPerFolder and maxFolders values are set in a way that would cause a conflict, the setting for maxFolders takes precedence over maxNodesPerFolder.
A calendar icon appears next to changeable date-formatted fields. When a user clicks the calendar icon, a calendar appears, as shown in the following image. Any date selected on this calendar is entered into the date field. Users can also enter dates into the date field manually.
Many DBMSs allow you to create a time stamp field. This automatically fills the field with the current date and/or time and saves the user having to do it. There are many reasons at an application level for doing this. The most common is to give reporting applications some way to track when a record was first created or when each change was entered.
Note: If you are using an external DBMS that directly supports Date and Time Stamp field types, you will not need to use this technique. Instead, make sure the field that contains the time stamp is set to Changeable = No to prevent Update Assist from touching that field.
To date-stamp a field in an Update Assist application, so that when a user clicks New, the application can set the initial value of the field to the current date in the stack before it is displayed in the form:
This imports the library of functions included with WebFOCUS Maintain.
COMPUTE TheDate/MDY = Today(); COMPUTE stack.datefield = TheDate;
where stack and datefield are the stack name and field name to which you want to assign the current date.
Note: If you have multiple fields that need to be set to the current date, you only need to set the variable TheDate once and can reuse it as many times as you need.
If you wanted the Release Date field from the MOVIES data source to contain the current date, your code would look like this:
COMPUTE TheDate/MDY = Today(); COMPUTE Movinfo_stack.RELDATE = TheDate;
Some DBMSs allow you to create an auto-number field. This automatically fills the field with a sequence number that is the last record index plus one. This saves the user having to make up an arbitrary key for the record.
To auto-number a field in an Update Assist application, so that when a user clicks New, the application can set the initial value of the field to the next sequence number in the stack before it is displayed in the form:
Stack clear SegmentNameStk; For all next MasterFileName.SegmentName.autonum into SegmentNameStk; NextVal/I5 = SegmentNameStk(SegmentNameStk.FOCCOUNT).val + 1; Stack clear SegmentNameStk;
Note: If you are using an external DBMS that directly supports Date Stamp field types, you will not need to use this technique.
By default, Update Assist clears all text boxes and controls in the form on a New action. You can have the values stay in the text boxes by editing the SegmentName.MNT file.
For example, users of some types of applications may be entering many similar records, one after another, and would like to display a record, then essentially have the New action display a copy of the record which they can edit before clicking Save.