on 12-12-2016 4:34 PM - last edited on 02-03-2024 7:04 PM by postmig_api_4
Hello. I need redirect attachment files in subdirectory of shared attachments directory via C#. Business object Attachments2 provides only sourcePath field, but not trgtPath. Is it possible to overwrite trgtPath? Even if move the file, then the target path will be invalid. I need function such as "Change Path" in context menu of attachment. Thank you.
Hi Roman,
The attachments are always copied to the folder defined in SAP Business One as the attachment folder.
From the SDK:
"The Attachments2 object enables to copy files from a source folder to the Attachments folder that is defined through the application."
You can define the attachments folder in the client, or using the PathAdmin object e.g.:
// Get the path admin object
CompanyService com_service = DICompany.GetCompanyService();
oPathAdmin = com_service.GetPathAdmin();
// Set new paths
oPathAdmin.WordTemplateFolderPath = "c:\Documnets\Templates\";
oPathAdmin.PicturesFolderPath = "c:\Documnets\Pictures\";
oPathAdmin.AttachmentsFolderPath = "c:\Documnets\Data\";
oPathAdmin.ExtensionsFolderPath = "c:\Documnets\Extention\";
// Update paths
com_service.UpdatePathAdmin(oPathAdmin);
Note that you can't move the file afterward, otherwise the "link" will be broken.
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.