Custom Pilot Currency Example: Solo Flight in Last 60 Days
In this example, we will create a custom currency definition that checks for at least one solo flight within the last 60 days, with an email alert sent 7 days prior to expiration.
Creating the definition
- 1. Go to the Custom Pilot Currency Definition screen.
- 2. Under "Currency Name", enter a name for this currency, for example, "Solo in Last 60 Days".
- 3. Under "Currency Period", enter 60 in the field and select "Days" from the drop-down if not already selected.
- 4. Check the box next to the text "Alert me" and enter 7 as the number of days in advance you wish to be alerted.
- 5. Leave the initialization script blank. For this script, we do not need to keep any totals of multiple flights over time, so we do not need an initialization script.
- 6. Enter the loop script exactly as shown below:
if (getfieldnum("Solo") == 1) currency_ok = 1;
- 7. Enter a description for this currency if you wish, and then save it.
- 8. After saving the definition, you can check the status of your custom currency from the View Pilot Currency Detail screen.
How it works
In this example, the loop script is executed for all your flights within the last 60 days. For each flight, we're checking the status of the Solo field. If the Solo field is true,
will return 1, otherwise it will return 0. If it returns one, we set the predefined variable
to 1. Setting this indicates that the currency check has passed, and your currency is valid.