I need to save some data to two files in D365FO, I have made this code to show the problem.
public static void main(Args _args)
{
str filePath,
filePathAndName,
fileContent = "01234567890123456789";
;
// prepare file name
filePath = System.IO.Path::GetTempPath();
filePathAndName = filePath 'f' guid2str(newGuid()) '.txt';
// Save file
File::SendStringAsFileToUser(fileContent, filePathAndName);
fileContent = "MY New Content";
File::SendStringAsFileToUser(fileContent, filePathAndName);
info(filePath);
info(filePathAndName);
info("done");
}
In this case only the last file is saved.
Any tips to how I can save data to two different files in D365FO?