Am doing pre-invoicing within my company using Filemaker 14.
The last thing i do in the script is to export the pre-invoicing details to an excel files, so i can send it out to all finans departments as details.
Our company is devided in different "Teranga" (units). At the moment i have 18 Terangas = 18 files i need to export to.
The script works as it is.. but.. if i need to remove or add Terangas i need to change in so many places.
All the Terangas are stored in a Value List named "Teranga" (inkluding an empty space for drop-down list).
Here is the code that am repeating 18 times in the same script:
Set Variable [$Teranga; Value: "3875"]
Enter Find Mode 
Set Field [Collection::Teranga; $Teranga]
Sort Records [Restore; No dialog]
Set Variable [$File; Value: $Teranga $ ".xlsx"]
Set Variable [$Link; Value: "filewin:/N:/<path to placement>" & $File]
Export Records [No dialog; "$Link"; Unicode (UTF-16)]
Am sure i can somehow use the Value List instead of needing to set the variable $Teranga manually, i just cant figure out how :/