Usecase:
Assume, a request template includes four additional fields: 'Zone,' 'Region' and 'District' and 'Cluster'. When a pick-list value for the 'Zone' field is selected, the corresponding field values for the 'Region', 'District' and 'Cluster' data must be dynamically populated by retrieving it from an externally stored CSV file. This will be useful when the number of field values increases.
Steps to follow:
1. Create 4 Additional fields and include these in the required template
- Zone - Single line additional field - Content will be populated from the CSV file as a Picklist value.
- Region - Single line additional field - Content will be populated from the CSV file as a Picklist value.
- District - Single line additional field - Content will be populated from the CSV file as a Picklist value.
- Cluster - Single line additional field - Content will be populated from the CSV file as a Picklist value.
2. Compose a CSV file with first column as the "Zone", then "Region", then 'District' and finally "Cluster". Place this CSV File in "<SDP_Home>\custom" Folder
3. Download the attached script and update the UDF Field names & CSV file headers in the script.
UDF Field Names can be taken from the FAFR window itself, type in the Field Label and you will get the respective Field Name.
4. Set up the script to execute On Form Load. The designated single-line fields will transform into picklists according to the user's selection.
If you are still unable to view the file despite retaining it in the custom folder, replace the attached security xml in location: <SDP_Home>\custom\WEB-INF\security folder
Included with this article are scripts for 3-field dependency, 4-field dependency, and 5-field dependency. Ensure that the required additional fields and their respective scripts are utilized accordingly.