Load a file from a filebox
and return the path to it.
This function retrieves the
path to a file which is stored in filebox.
The filebox can be on the details
screen of any type of modul in Seminar Pro (address, event, info, etc)
In the example below we are
looking for a file in a filebox which is used in Events. We pass in the name of
the filebox
as a paramter and also the id
of a specific event. If the parameter FileName
matches with the name of a file in this filebox,
then it is copied from
database to a local temporary folder and the path to it is returned by this
function.
The returned path string can
now be used to attach this file to an email.
Parameters:
Name |
Type |
Description |
FieldName |
String |
Name
of the filebox, for example: imFB_evt_Files |
FileName |
String |
Name
of the file to be retrieved from the filebox, like: AGBs.pdf |
RecID |
Integer |
id of the
the record which contains the file to be retrieved. For
instance the id of a specific event. In the example below we are retrieving
the id of an event and storing it in the variable evt_id. |
Returns:
Type |
Value |
Description |
String |
path to
file |
The
full native path to the retrieved file. For
example: /Users/oliver/Library/Containers/com.osswald.pro.seminar/Data/Library/Application
Support/Seminar.pro/im_4B1EC3F8-4F4B-4B9C-A285-AB781D8F8944/temp/9E36F628-521C-4CCE-AD70-021901A2FB8B/AGBs.pdf |
Available in:
WindowMain |
WindowLink |
NO |
YES |
Used in:
XojoScript
Name |
GUID |
Send
Seminar Invoice by Email |
024F872B-9E87-499F-9D2D-208C4C32E4CF |
Hint: You can find
references to XojoScripts which make use of this function by sending the
following SQL statement to the database:
Select id,GUID, ScriptName,ScriptCode from
im_scripts where ScriptCode Like '%GetFilePath%'
Example XojoScript:
// Get id of selected event in registration window
Dim
evt_id As Integer
= LinkList_GetID("evt")
// Get path to a file which is stored in a filebox of a
particular event, to be attached to email
Dim
file1 As String
= GetFilePath("imFB_evt_Files","AGBs.pdf",evt_id)