How to change from UploadCollection control to UploadSet in Stand Alone Apps
This step-by-step guide applies exclusively to FAB version 3.3.2 and above. The client system is required to be on UI5 version 1.88 or higher.
1. Identify all stand-alone FAB Form Apps that uses the deprecated controls, Upload Collection or Upload Collection By Key, and ensure they are backed up.
Once the upgrade is complete, whether it's a FAB upgrade or a UI5 version upgrade, compile a list of FAB Form apps within the system that require updates to their attachment controls. Below is an example checklist table for the tasks to be accomplished and checked.
App UI Name | With Upload Collection Control? | With UploadSet.js? | Need to Regenerate BSP? | Need to update form controller? |
---|---|---|---|---|
ZFAB_* | Yes/No | Yes/No | Yes/No | Yes/No |
Make sure to create backups of the FAB form app, its code implementation, and the workflow configuration by utilizing the Export features found in the Form App, Code Implementation, and Process Designer areas, respectively.
2. Check and regenerate the BSP to include UploadSet.js in the application files under WebContent > Controls.
If all relevant FAB form applications are part of the same package, for example, ZIQX*, you can conveniently view the BSP application files in SE80. Look for UploadSet.js in the application's WebContent >Controls folder. This file should be automatically included for FAB form applications with BSP applications created after the FAB 3.3.2 upgrade.
If UploadSet.js is missing, you will need to regenerate the BSP through the transaction /IQX/FAB by selecting Properties and then Generate BSP.
Once done, verify the UploadSet.js in the WebContent > Controls application files.
3. Replace all UploadCollection controls in the FAB Form Hierarchy.
Do not remove the uploadCollection controls. Instead, disable them and make them invisible in the layout. Additionally, try to replicate the layout used for the uploadCollection as much as possible.
To add the UploadSet control as per your requirement, follow these steps:
4. Adjust Form Structure, Controller and GS_DATA model as needed
Custom scripts are sometimes used for events that involve uploading attachments. Below is a sample comparison:
In cases like these, it's necessary to update the form structure, controller and data model accordingly.
Here is quick reference for FAB built-in scripts conversion:
Upload Collection → Upload Set
Event On Upload → Event Before Upload Starts
fabHandleFileUploadByKey(evt) → fabHandleFileUploadByKey2(evt)
Event On Upload Complete
fabOnFileUploadByKeyComplete(evt) → fabOnFileUploadByKeyComplete2(evt)
Event On Delete
fabOnFileByKeyDeleted(evt) → fabOnFileByKeyDeleted2(evt)
Here are some sample script adjustments for Capital Expenditure Request