AddAttachement
Back to ListDescription: Select an attachement file to an EMAIL and insert into the Attachement table
FileMaker Prototype:
Set Variable [$res; ACF_Run("AddAttachement";)]
Category: EMAIL
NOTE: This function serves as a reference template. To use it effectively, you may need to adjust certain parts of the code, such as field names, database structures, and specific data lists to fit the requirements of your system. This customization allows the function to work seamlessly within your environment.
Function source:
function AddAttachement ()
string path = select_file ("Select file to add to the e-mail", desktop_directory());
string primkey, sql, res;
if ( path != "" ) then
primkey = Email_Messages::PrimaryKey;
sql = "SELECT FilePath FROM Email_Attachements WHERE fk_EmailMessage = :primkey AND FilePath = :path";
res = ExecuteSQL ( sql);
if ( res != "") then
alert ( "File allready added: " + res);
return "";
end if
sql = "INSERT INTO Email_Attachements (fk_EmailMessage, FilePath) VALUES (:primkey, :path)";
res = ExecuteSQL ( sql);
return res;
end if
return "";
end
