- 10 Jan 2023
- 5 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
Details Page UI and App Variables
- Updated on 10 Jan 2023
- 5 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
The Details page is used to display records under one batch. The End-User can perform the following actions in the Details page:
- View the Batch Name and the Date and Plant data in the selected batch
- View the Count of records in the selected batch
- View the list of records in the selected batch. List of records in this use-case has the following data:
- Log Tag
- Sloc
- Add more records to the batch
- Edit a record in the batch
- Delete a record in the batch
- Undo one of the above two actions edit or delete a record
- Delete the entire batch. In this case, the deleted batch data should be automatically sent to server for audit purposes.
The following image shows the UI design in Details page:
Functionality | Component | App Variables | Data Type |
---|---|---|---|
View Batch Name | Text | Header.BatchName | String |
View Date | Text | Header.Date | String |
View Plant | Text | Header.Plant | String |
View Count of records in the batch | Text | Logs.$count | -NA- |
View list of records in the batch | List View | Logs | String |
View Log Tag of each record | Text | Logs.LogTag | String |
View Sloc of each record | Text | Logs.Sloc | String |
Add more records to the batch | Button | -NA- | |
Edit a record | Button | -NA- | |
Delete a record | Button | -NA- | |
Undo one recent action (Edit OR Delete a record) | Button | -NA- | |
Delete the entire batch | Button | -NA- | |
Go back to Review page | Button | -NA- |
Table 3-1: App variables in Details page
How do I see the details from the selected batch?
In the Details page of the App designer, the platform automatically displays the record that has been clicked by the developer in the previous page. The developer has to just use the same table variable and desired column to display the details in the selected batch.
In the following image, no additional logic is written to display the details:
How do I see only the records in the selected batch?
In App Designer, the Filter property can be used to filter Logs data that matches with the BatchName of the selected batch. To use the filter option, do the following:
1. Select the List View component in Details page and click the Filter button in the right pane.
2. In the pop-up window, choose BatchName EQUAL Header.BatchName and click Save.
Why did I use Logs.$count instead of Header.Count?
The Header.Count is a computed field in Review page. In Details page, this count may vary if more records are added to the batch or if records are deleted. To avoid updating count on each action, Logs.$count will automatically populate the exact number of records under each batch without any implementation effort.
Details Page Scripts
On clicking the Details button for a desired batch, the End-User is shown:
- The selected batch and its details
- All records in the batch and
- All actions that can be taken on the batch.
Details -> onPageShow event
In the script for Details page onPageShow event, some app logic variables are set to reset. Refer snippet below:
Details -> button_addToBatch -> click
Adding logs to an existing batch involves three steps:
- Obtain the batch specific Date and Plant values (selected_date, selected_plant) as these two values remain the same for all records added under it.
- Disable the Data and Plant fields in Home page (boolEnable_textinput_date, boolEnable_select_plant) as those values must not change when adding more records to the batch.
- Pick up the last used Storage Location to be auto-populated by default (selected_sloc). However, this field is enabled for change if desired by the End-User.
In addition to the above steps, selected_BatchName is copied to BatchName variable. This app logic is carried out in the button script. Refer snippet below:
Details -> button_update
Based on the platform design, any data changes made to transaction data mapped in the corresponding fields will automatically be updated into the app variable. Therefore, the record values are retained in a separate business function variable, to be used in case of an Undo action taken later.
App Variables | Data Type |
---|---|
log_action_logtag | String |
log_action_sloc_old | String |
log_action | String (Values: <empty> or Update or Delete) |
Details -> select_dialog_sloc -> change event
The actual change of value in this use-case is performed within a pop up dialog box. The Select component in the dialog box displays the list of Storage Locations associated with the Header.Plant.
The Data and Filter property of the select_dialog_sloc event is shown below:
Details -> button_delete -> click
The unique identifier of the record (in this case, LogTag) is fetched to be used to identify the row to be removed. The variable used to fetch the unique identifier is shown below:
App Variables | Data Type |
---|---|
log_logtag | String |
The script used to fetch the unique identifier is shown below:
The remove action is performed after a confirmation pop up box is shown to the user. Refer Details Page Scripts -> button_delete_log_yes -> click for snippet of remove at index script.
Details -> button_delete_log_yes -> click
On confirming the delete record, the fetched unique identifier (in this case, LogTag) is used to identify the index of the row in Logs table. The Inlist remove at index block is used to delete a record from the transaction data.
Refer script snippet below:
Storing the record data in a separate business function variable to be used if an undo action is undertaken later.
App Variables | Data type |
---|---|
log_action_sloc | String |
Details -> button_undo -> click
The undo operation in this use-case is limited to undoing one recent action (Update or Delete). If the recent action is Update, old Sloc value is copied to the record. If the recent action is Delete, the removed record is inserted back to the Logs variable.
Refer script snippet below for the logic written.
Details -> button_deleteBatch -> click
By clicking the delete button at the top right of the screen deletes the entire batch. The current implementation doesn’t confirm batch level delete action. Therefore the associated script is inside the button_deleteBatch -> click event. Also, based on this use-case requirement, the Status of the batch is marked as Deleted. No records are actually deleted. The details of the deleted batch is sent to the server for audit.
If the batch that belongs to the current session is emptied, the BatchName value is emptied to re-initialize the session if End-User navigates back to Home page.
Refer snippet below:
Details page uses Interactions property for all buttons except one that exists in its page. The interactions used for the following buttons are mentioned in the table below:
Button | Interactions |
---|---|
Add to Batch | Navigate to Home page |
Delete Batch | Navigate to BOS_deletedBatch |
Update record | Open dialog to receive new Sloc value |
Delete record | Open dialog to confirm delete |
Back button | Navigate to ‘Go Back’ |
Undo button | -NA- |
Developing Business Logic BOS for Details Page
BOS_deletedBatch
This BOS posts details of deleted batch to the server for audit purposes. Refer Appendix C for Database schema of table that will store the transaction data. Refer screenshot below:
All App Variables created so far are consolidated in Appendix B-1.
The columns in App Variables of type Table are listed in Appendix B-2.