Adding files to a module

When to use

Sometimes you want to store files, eg reports, Excel, images, etc, in an Extender module, so they can be used to create setup data or document the module.

To add a file

Use the Files Tab in the Modules screen.

Focus on the grid and press Insert on the keyboard to add a file.

You can optionally give it a password.

Tip: You can change / remove the password by double clicking on the Has Password cell.

How to use in another company

The file is exported in the .vi file and is imported into other databases when you import the module.

Using the file in a script

To use the file in a script, you call getFile(name, password, destFileName),

Example: getFile(“orchid.aom.view.html”, “password”, “c:\\folder\\view.html”)

Gets the file from the database and writes it to destFileName.

Copy

getFile example

int getFile(string name, string password, string destFileName)
 

Returns:

  • 0 = success

  • 1 = not found

  • 2 = bad password

  • 3 = error

Password protecting a file

If you password protect the file then you’d want to password protect your script that calls getFile too.

Password protecting a file means users can’t see the file in the scripts folder and they can’t edit it without knowing the password.

If the file has no password then it will be in the scripts folder and you won’t need to use getFile.