Adding custom (persistent) code
Each screen can store pieces of code with its data. This piece of code will be inserted just after this screen is received. The inserted code will be executed only in the run time of the generated code and will not work during design time in the HFLI.
When the navigation is saved, a new file HFClass.cs (or HFClass.vb, HFClass.asmx depending on the application language and the selected code type) is created and added to the project.
Each time a navigation in a project is saved, the file HFClass.cs is regenerated and overwritten. This will cause you to loose any changes that you may have manually introduced to this file meanwhile.
If you wish to make many changes to the generated code, then change the name of the file and start working with it separately outside the HFLI environment. If you want to make minor changes, then use the persistent code editor.
Follow the steps below to add a persistent code to a screen.
1. Select it then locate its CodeText property in the property grid (or double click on Code Text node under its sub-tree).
2. Click on the ellipsis next to it to launch the editor.
3. Type your code and click OK.
The code entered is saved with the navigation code every time you save the code.
In your persistent code, you can use the temporary parameters from the navigation screens both as input and output parameters. This allows you, for example, to take a value from screen A, provide this value as input to an external object (might be another navigation recorded earlier with the HFLI), get a reply from the external object, and use it as input for the next screen, e.g., screen B.
This allows you to create nested and complicated navigations by using pre-recorded navigations and then using them as building stones.