Load data to additional fields dynamically from an external CSV file based on another field value.
Usecase:
Assume, a request template includes three additional fields: 'Client Code,' 'Client Name,' and 'Client Address.' When a pick-list value for the 'Client Code' field is selected, the corresponding field values for the 'Client Name' and 'Client Address' 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 3 Additional fields and include these in the required template
- Client Code - Picklist additional field - Content has to be pre populated with all the client codes(script1) or Single Line additional field - we can load this content from CSV as well(script2)
- Client Name - Single line additional field - Content will be populated from the CSV File
- Client Address - Single line additional field - Content will be populated from the CSV File.
2. Compose a CSV file with first column as the "Client Code", then "Client Name" and finally "Client Address". 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. Configure the script on Field change for the first additional field : Client Code.
5. Other fields will be auto populated.
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