[External] Codeunit 419 - CreateFileNameWithExtension (Old)
We often want to generate document names with a predefined name (not a temp name), completed with the document extension. Function 'CreateFileNameWithExtension' is suited for this, but not exposed.
- [x] Solved in BC14
We need this as well to migrate one of our add-ons. I have questions on it though...
-
I assume we don't have folders and things available to use which is fine...so can we call a function to create a specific file name with an extension in the temp folder on the server?
-
How are temp folders / files managed in the shared/cloud environment? We might have multiple tenants with our add-on using our functionality to create files at the same time where the file names are identical. Does each tenant get its own subfolder within the temp folder? Is there a risk of file conflicts?
Can we get an OnBefore publisher as well?
In some scenarios, the CreateFileNameWithExtension function is called with 'FileName.Doc' instead of 'FileName', so we tend to double check if the 'FileNameWithoutExtension' input parameter actually has an extension in it, and if so, we strip it.
`CreateFileNameWithExtension(FileNameWithoutExtension : Text;Extension : Text) FileName : Text
FileNameWithoutExtension := FileManagementNVT.RemoveExtensionFromFileName(FileNameWithoutExtension); // NVT
FileName := FileNameWithoutExtension;
IF Extension <> '' THEN BEGIN
IF Extension[1] <> '.' THEN
FileName := FileName + '.';
FileName := FileName + Extension;
END`
@jobulsin Any possibility that this publisher will be backported to BC14? Couldn't find it in the latest sandbox image.