From 8b0d26ed5619f2b0cfcbe5c859868e6826c3e215 Mon Sep 17 00:00:00 2001 From: Kasper Lind Date: Fri, 12 Sep 2025 11:03:24 +0200 Subject: [PATCH 1/5] Cloud File Mgt --- Cloud File Mgt/app.json | 39 ++++ .../PTEFileMgtSharepoint.Codeunit.al | 213 ++++++++++++++++++ .../src/Sharepoint/PTESHFoldersList.Page.al | 44 ++++ .../Sharepoint/PTESharepointFolders.Table.al | 76 +++++++ 4 files changed, 372 insertions(+) create mode 100644 Cloud File Mgt/app.json create mode 100644 Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al create mode 100644 Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al create mode 100644 Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al diff --git a/Cloud File Mgt/app.json b/Cloud File Mgt/app.json new file mode 100644 index 0000000..ba4100a --- /dev/null +++ b/Cloud File Mgt/app.json @@ -0,0 +1,39 @@ +{ + "id": "2051d42a-342f-4d28-9b3e-ed86d590a40f", + "name": "Cloud File Mgt", + "publisher": "PrintVis A/S", + "version": "1.0.0.0", + "brief": "", + "description": "", + "privacyStatement": "", + "EULA": "", + "help": "", + "url": "", + "logo": "", + "dependencies": [ + { + "id": "5452f323-059e-499a-9753-5d2c07eef904", + "name": "PrintVis", + "publisher": "PrintVis A/S", + "version": "26.0.0.0" + } + ], + "screenshots": [], + "platform": "1.0.0.0", + "application": "26.0.0.0", + "idRanges": [ + { + "from": 80400, + "to": 80419 + } + ], + "resourceExposurePolicy": { + "allowDebugging": true, + "allowDownloadingSource": true, + "includeSourceInSymbolFile": true + }, + "runtime": "14.0", + "features": [ + "NoImplicitWith" + ] +} \ No newline at end of file diff --git a/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al b/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al new file mode 100644 index 0000000..b25df13 --- /dev/null +++ b/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al @@ -0,0 +1,213 @@ +codeunit 80400 "PTE File Mgt Sharepoint" +{ + SingleInstance = true; + + procedure Helper_Upload_SingleFile(TempBlob: Codeunit "Temp Blob"; SubFolderPathId: Text; ServerFileName: Text) + var + TempCloudStorage: Record "PVS Cloud Storage" temporary; + begin + // ***************************************** + // * Upload generated files using Sharepoint + // ***************************************** + if SubFolderPathId = '' then + Error('No folder selected!'); + + if not TempCloudStorage.IsTemporary() then + Error('Not temporary!'); + GlobalProvider := GlobalProvider::Graph; + CloudStorageManagement.FillBufferOnOpenPage(TempCloudStorage, AuthProviderRec, GlobalProvider, WriteAccessVisible, DeleteAccessVisible, ReadAccessVisible, SubFolderPathId, GlobalCaption); + + TempCloudStorage.Reset(); + TempCloudStorage.SetRange(Name, 'FolderName'); + + TempCloudStorage.SetRange(Type, TempCloudStorage.Type::Folder); + if TempCloudStorage.FindFirst() then + Helper_Upload_File(TempCloudStorage, TempBlob, ServerFileName) + else begin + TempCloudStorage.Reset(); + TempCloudStorage.SetRange(Name, '.'); + TempCloudStorage.SetRange(Type, TempCloudStorage.Type::Folder); + if TempCloudStorage.FindFirst() then + // Helper_CreateFolder(TempCloudStorage, SubFolderPath); + Helper_Upload_File(TempCloudStorage, TempBlob, ServerFileName); + end; + end; + + local procedure Helper_Upload_File(var CloudStorage: Record "PVS Cloud Storage"; TempBlob: Codeunit "Temp Blob"; ServerFileName: Text): Boolean + var + NewFileID: Text; + begin + if CloudStorage.Provider = CloudStorage.Provider::Graph then + Helper_Upload_FileWithoutDialog(true, CloudStorage, NewFileID, TempBlob, ServerFileName); + + exit(NewFileID <> ''); + end; + + local procedure Helper_Upload_FileWithoutDialog(inRefreshTree: Boolean; var outTempCloudStorageRec: Record "PVS Cloud Storage"; var outNewFileID: Text; TempBlob: Codeunit "Temp Blob"; ServerFileName: Text) + begin + if outTempCloudStorageRec.Type <> outTempCloudStorageRec.Type::Folder then + Error(SelectFolder_Lbl); + + if ServerFileName <> '' then begin + MiscFct.OpenDialog(UploadStart_Lbl); + if GraphMgt.UploadFile(TempBlob, ServerFileName, outTempCloudStorageRec.ID, outNewFileID) then begin + MiscFct.CloseDialog(); + if inRefreshTree then begin + outTempCloudStorageRec."Contents Count" += 1; + outTempCloudStorageRec.Modify(); + GraphMgt.GetFolder(outTempCloudStorageRec.Level, outTempCloudStorageRec.ID, outTempCloudStorageRec.Name, false, outTempCloudStorageRec); + end; + end else begin + MiscFct.CloseDialog(); + Error(UploadError_Lbl, NAVFileMgt.GetFileName(ServerFileName)); + end; + end; + + end; + + /* procedure GetBatchRec(): Boolean + begin + BatchRec.SetRange(BatchRec."Custom Object type", BatchRec."Custom Object type"::Codeunit); + BatchRec.SetRange(BatchRec."Custom Object ID", Codeunit::"PTE AS400 Mgt"); + if BatchRec.IsEmpty() then begin + BatchRec.SetRange(BatchRec."Custom Object type", BatchRec."Custom Object type"::Report); + BatchRec.SetRange(BatchRec."Custom Object ID", 50151); + end; + exit(BatchRec.FindFirst()); + end; */ + procedure GetFilesList(FolderId: Text; var CloudStorage_Out: Record "PVS Cloud Storage" temporary): Boolean + var + // CloudStorage: Record "PVS Cloud Storage"; + AuthProviderRec_: Record "PVS Auth. Providers"; + temp_CloudStorage_: Record "PVS Cloud Storage" temporary; + // GraphMgt: Codeunit "PVS Cloud Graph Management"; + GlobalCaption_: Text; + GlobalProvider_: Option " ",Graph; + DeleteAccessVisible_: Boolean; + ReadAccessVisible_: Boolean; + WriteAccessVisible_: Boolean; + // PVSFolders: Record "PVS Folder"; + // Blob: Codeunit "Temp Blob"; + // ServerFileName: Text; + // ShareLink: text; + // FileManagement: Codeunit "File Management"; + begin + /* //Set Filters + PVSFolders.SetRange("Folder ID", InventorySetup."PTE Inv Receiving Folder Id"); + PVSFolders.SetRange("Storage Type", PVSFolders."Storage Type"::Graph); + PVSFolders.SetRange(Usage, PVSFolders.Usage::Artwork); + if PVSFolders.IsEmpty() then exit; + //Set Filters + + if PVSFolders.FindSet(false) then + repeat */ + GlobalProvider_ := GlobalProvider_::Graph; + + CloudStorageManagement.FillBufferOnOpenPage( + temp_CloudStorage_, AuthProviderRec_, GlobalProvider_, + WriteAccessVisible_, DeleteAccessVisible_, ReadAccessVisible_, + FolderId, GlobalCaption_); + + CloudStorageManagement.ExpandAll(temp_CloudStorage_, FolderId, 'Folder Expanding'); + temp_CloudStorage_.SetRange(type, temp_CloudStorage_.type::File); + temp_CloudStorage_.SetFilter(Name, '<>%1|<>%2', '', '.'); + // if CloudStorage_.FindSet(false) then + /* repeat + ShareLink := GraphMgt.GetShareLink(CloudStorage.ID, 0); + ValueBuffer_.AddNewEntry(FileManagement.GetFileNameWithoutExtension(CloudStorage.Name), CloudStorage.Name); + + + until CloudStorage.Next() = 0; */ + // until PVSFolders.Next() = 0; + temp_CloudStorage_.Reset(); + temp_CloudStorage_.SetRange(type, temp_CloudStorage_.type::File); + temp_CloudStorage_.SetFilter(Name, '<>%1|<>%2', '', '.'); + if not temp_CloudStorage_.FindSet() then + error('is empty, please check setup / sharepoint'); + repeat + CloudStorage_Out := temp_CloudStorage_; + CloudStorage_Out.Insert(); + until temp_CloudStorage_.Next() = 0; + + exit(true); + end; + + procedure FileExists(FolderId: Text; FileName: Text): Boolean //used in JDF APP + var + Temp_CloudStorage_Out: Record "PVS Cloud Storage" temporary; + begin + if not GetFilesList(FolderId, Temp_CloudStorage_Out) then + exit; + + WHILE STRPOS(FileName, '\') <> 0 DO + FileName := CopyStr(FileName, 1 + STRPOS(FileName, '\')); + + Temp_CloudStorage_Out.SetRange(Name, FileName); + if not Temp_CloudStorage_Out.IsEmpty then + exit(true) + end; + + procedure GetFolderFromPath(Path: Text): Text[50] + var + Index: Integer; + Str: Text[50]; + begin + Index := Path.LastIndexOf('/'); + Str := CopyStr(Path, Index + 1, 50); + exit(Str); + end; + + + procedure GetFolderID(Code_in: Code[20]): Code[50]; + var + Folders: Record "PTE Sharepoint Folders"; + Folder_Error_Lbl: Label 'Can not find folder %1', Comment = '%1 = Folder Code'; + begin + Folders.SetRange(CODE, Code_in); + if Folders.IsEmpty() then + Error(Folder_Error_Lbl, Code_in); + + Folders.FindFirst(); + exit(Folders."Folder Id") + + + end; + + procedure MoveFileToFolderWithID(CloudStorage_: Record "PVS Cloud Storage" temporary; To_Folder_Id: Text) + var + FileMgtCloud: Codeunit "PTE File Mgt Sharepoint"; + CloudStorageManagement_: Codeunit "PVS Cloud Storage Management"; + CloudGraphManagement: Codeunit "PVS Cloud Graph Management"; + TempBlob: Codeunit "Temp Blob"; + _InStream: InStream; + OStream: OutStream; + + ServerFileName: Text; + begin + if CloudStorage_.Type <> CloudStorage_.Type::File then + exit; + + CloudStorageManagement_.DownloadServerFile(CloudStorage_, TempBlob, ServerFileName); + TempBlob.CreateInStream(_InStream); + + TempBlob.CreateOutStream(OStream); + FileMgtCloud.Helper_Upload_SingleFile(TempBlob, To_Folder_Id, CloudStorage_.Name); + + CloudGraphManagement.DeleteFile(CloudStorage_.ID, CloudStorage_.name, true); + end; + + var + AuthProviderRec: Record "PVS Auth. Providers"; + NAVFileMgt: Codeunit "File Management"; + GraphMgt: Codeunit "PVS Cloud Graph Management"; + CloudStorageManagement: Codeunit "PVS Cloud Storage Management"; + MiscFct: Codeunit "PVS Misc. Fct."; + DeleteAccessVisible: Boolean; + ReadAccessVisible: Boolean; + WriteAccessVisible: Boolean; + SelectFolder_Lbl: Label 'Please select a folder to upload the file to'; + UploadError_Lbl: Label 'Uploading of file %1 failed', Comment = '%1 = File name'; + UploadStart_Lbl: Label 'Uploading file to OneDrive...'; + GlobalProvider: Option " ",Graph; + GlobalCaption: Text; +} \ No newline at end of file diff --git a/Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al b/Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al new file mode 100644 index 0000000..9bc8419 --- /dev/null +++ b/Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al @@ -0,0 +1,44 @@ +page 80400 "PTE SH Folders List" +{ + Caption = 'Sharepoint Folders List'; + PageType = List; + UsageCategory = Lists; + ApplicationArea = All; + SourceTable = "PTE Sharepoint Folders"; + layout + { + area(Content) + { + repeater(Group) + { + field(CODE; rec.CODE) + { + ApplicationArea = All; + } + field("Folder Name"; rec."Folder Name") + { + ApplicationArea = all; + } + field(" Folder Path"; rec."Folder Path") + { + ApplicationArea = All; + trigger OnAssistEdit() + var + Folders: Record "PTE Sharepoint Folders"; + begin + Folders._Folder_Path_OnAssistEdit_PathRoot(Rec); + end; + } + field(" Folder Id"; rec."Folder Id") + { + ApplicationArea = All; + } + + } + } + + } + + + +} \ No newline at end of file diff --git a/Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al b/Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al new file mode 100644 index 0000000..3e41cac --- /dev/null +++ b/Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al @@ -0,0 +1,76 @@ +table 80400 "PTE Sharepoint Folders" +{ + DataClassification = SystemMetadata; + + fields + { + field(1; CODE; Code[20]) + { + Caption = 'Code'; + ToolTip = 'Code for the table'; + } + field(2; "Folder Path"; Text[2048]) + { + Caption = 'Folder path'; + ToolTip = 'The Folder path'; + } + field(3; "Folder Name"; Text[50]) + { + Caption = 'Folder Name'; + ToolTip = 'Name of the Folder'; + Editable = false; + } + field(4; "Folder Id"; Text[50]) + { + Caption = 'Folder Id'; + ToolTip = 'The Folder Id'; + Editable = false; + } + } + + keys + { + key(Key1; CODE) + { + Clustered = true; + } + } + + + trigger OnInsert() + begin + + end; + + trigger OnModify() + begin + + end; + + trigger OnDelete() + begin + + end; + + trigger OnRename() + begin + + end; + + internal procedure _Folder_Path_OnAssistEdit_PathRoot(Folders_: Record "PTE Sharepoint Folders") + var + GraphMgt: Codeunit "PVS Cloud Graph Management"; + FileMgtCloud: Codeunit "PTE File Mgt Sharepoint"; + NewID: Text[50]; + FolderPath: Text; + begin + if GraphMgt.FilePicker(1, '', '', FolderPath, NewID) then begin + Folders_."Folder Id" := NewID; + if Folders_."Folder Id" <> '' then + Folders_."Folder Path" := CopyStr(FolderPath, 1, MaxStrLen(Folders_."Folder Path")); + end; + Folders_."Folder Name" := FileMgtCloud.GetFolderFromPath(Folders_."Folder Path"); + + Folders_.Modify(false); + end; +} \ No newline at end of file From a0e54f2d6ef1f26496b70a9eaf8171b05340226c Mon Sep 17 00:00:00 2001 From: Kasper Lind Date: Fri, 12 Sep 2025 14:30:52 +0200 Subject: [PATCH 2/5] add Permission set --- .../Permissions/PTECloudFileMgt.permissionset.al | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Cloud File Mgt/Permissions/PTECloudFileMgt.permissionset.al diff --git a/Cloud File Mgt/Permissions/PTECloudFileMgt.permissionset.al b/Cloud File Mgt/Permissions/PTECloudFileMgt.permissionset.al new file mode 100644 index 0000000..f4e1fa5 --- /dev/null +++ b/Cloud File Mgt/Permissions/PTECloudFileMgt.permissionset.al @@ -0,0 +1,8 @@ +permissionset 80400 PTECloudFileMgt +{ + Assignable = true; + Permissions = tabledata "PTE Sharepoint Folders"=RIMD, + table "PTE Sharepoint Folders"=X, + codeunit "PTE File Mgt Sharepoint"=X, + page "PTE SH Folders List"=X; +} \ No newline at end of file From 1e9dfbc4d5b3a31738ebe1521378f1ee62207858 Mon Sep 17 00:00:00 2001 From: Kasper Lind Date: Wed, 10 Dec 2025 14:35:39 +0100 Subject: [PATCH 3/5] fix noew line error issue --- Cloud File Mgt/app.json | 2 +- .../PTEFileMgtSharepoint.Codeunit.al | 34 ------------------- .../src/Sharepoint/PTESHFoldersList.Page.al | 1 + 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/Cloud File Mgt/app.json b/Cloud File Mgt/app.json index ba4100a..a6620db 100644 --- a/Cloud File Mgt/app.json +++ b/Cloud File Mgt/app.json @@ -2,7 +2,7 @@ "id": "2051d42a-342f-4d28-9b3e-ed86d590a40f", "name": "Cloud File Mgt", "publisher": "PrintVis A/S", - "version": "1.0.0.0", + "version": "1.0.0.2", "brief": "", "description": "", "privacyStatement": "", diff --git a/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al b/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al index b25df13..d49e86b 100644 --- a/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al +++ b/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al @@ -65,42 +65,16 @@ codeunit 80400 "PTE File Mgt Sharepoint" end; - /* procedure GetBatchRec(): Boolean - begin - BatchRec.SetRange(BatchRec."Custom Object type", BatchRec."Custom Object type"::Codeunit); - BatchRec.SetRange(BatchRec."Custom Object ID", Codeunit::"PTE AS400 Mgt"); - if BatchRec.IsEmpty() then begin - BatchRec.SetRange(BatchRec."Custom Object type", BatchRec."Custom Object type"::Report); - BatchRec.SetRange(BatchRec."Custom Object ID", 50151); - end; - exit(BatchRec.FindFirst()); - end; */ procedure GetFilesList(FolderId: Text; var CloudStorage_Out: Record "PVS Cloud Storage" temporary): Boolean var - // CloudStorage: Record "PVS Cloud Storage"; AuthProviderRec_: Record "PVS Auth. Providers"; temp_CloudStorage_: Record "PVS Cloud Storage" temporary; - // GraphMgt: Codeunit "PVS Cloud Graph Management"; GlobalCaption_: Text; GlobalProvider_: Option " ",Graph; DeleteAccessVisible_: Boolean; ReadAccessVisible_: Boolean; WriteAccessVisible_: Boolean; - // PVSFolders: Record "PVS Folder"; - // Blob: Codeunit "Temp Blob"; - // ServerFileName: Text; - // ShareLink: text; - // FileManagement: Codeunit "File Management"; begin - /* //Set Filters - PVSFolders.SetRange("Folder ID", InventorySetup."PTE Inv Receiving Folder Id"); - PVSFolders.SetRange("Storage Type", PVSFolders."Storage Type"::Graph); - PVSFolders.SetRange(Usage, PVSFolders.Usage::Artwork); - if PVSFolders.IsEmpty() then exit; - //Set Filters - - if PVSFolders.FindSet(false) then - repeat */ GlobalProvider_ := GlobalProvider_::Graph; CloudStorageManagement.FillBufferOnOpenPage( @@ -111,14 +85,6 @@ codeunit 80400 "PTE File Mgt Sharepoint" CloudStorageManagement.ExpandAll(temp_CloudStorage_, FolderId, 'Folder Expanding'); temp_CloudStorage_.SetRange(type, temp_CloudStorage_.type::File); temp_CloudStorage_.SetFilter(Name, '<>%1|<>%2', '', '.'); - // if CloudStorage_.FindSet(false) then - /* repeat - ShareLink := GraphMgt.GetShareLink(CloudStorage.ID, 0); - ValueBuffer_.AddNewEntry(FileManagement.GetFileNameWithoutExtension(CloudStorage.Name), CloudStorage.Name); - - - until CloudStorage.Next() = 0; */ - // until PVSFolders.Next() = 0; temp_CloudStorage_.Reset(); temp_CloudStorage_.SetRange(type, temp_CloudStorage_.type::File); temp_CloudStorage_.SetFilter(Name, '<>%1|<>%2', '', '.'); diff --git a/Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al b/Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al index 9bc8419..da004cc 100644 --- a/Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al +++ b/Cloud File Mgt/src/Sharepoint/PTESHFoldersList.Page.al @@ -27,6 +27,7 @@ page 80400 "PTE SH Folders List" Folders: Record "PTE Sharepoint Folders"; begin Folders._Folder_Path_OnAssistEdit_PathRoot(Rec); + CurrPage.Update(false); end; } field(" Folder Id"; rec."Folder Id") From 33d4834253e9fd91c4cbb5b178557f1b836635a2 Mon Sep 17 00:00:00 2001 From: Kasper Lind Date: Thu, 11 Dec 2025 08:50:14 +0100 Subject: [PATCH 4/5] add readme.md --- Cloud File Mgt/app.json | 2 +- Cloud File Mgt/readme.md | 37 +++++++++++++++++++ .../Sharepoint/PTESharepointFolders.Table.al | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 Cloud File Mgt/readme.md diff --git a/Cloud File Mgt/app.json b/Cloud File Mgt/app.json index a6620db..bd1088e 100644 --- a/Cloud File Mgt/app.json +++ b/Cloud File Mgt/app.json @@ -2,7 +2,7 @@ "id": "2051d42a-342f-4d28-9b3e-ed86d590a40f", "name": "Cloud File Mgt", "publisher": "PrintVis A/S", - "version": "1.0.0.2", + "version": "1.0.0.3", "brief": "", "description": "", "privacyStatement": "", diff --git a/Cloud File Mgt/readme.md b/Cloud File Mgt/readme.md new file mode 100644 index 0000000..f868615 --- /dev/null +++ b/Cloud File Mgt/readme.md @@ -0,0 +1,37 @@ +# Cloud File Mgt + +PrintVisCloud File Mgt functionality makes it easy to upload and move files to and from SharePoint + + +## What this extension includes: + +- Procedures that makes it possible to Up -/ Download files to and from SharePoint that is not connected with any PVS Cases, such as import of files that. +below is a snippte on how to use whare the only input is the folder id's from the "PTE Sharepoint Folders" table. + +``` + procedure DownloadFilesAndProcess(ImportFolderID: Code[50]; ArchiveFolderID: Code[50]) + var + temp_CloudStorage: Record "PVS Cloud Storage" temporary; + FileMgt: Codeunit "PTE File Mgt Sharepoint"; + TempBlob: Codeunit "Temp Blob"; + CloudStorageManagement: Codeunit "PVS Cloud Storage Management"; + ServerFileName: Text; + _InStream: InStream; + OStream: OutStream; + XMLImportProcess: Codeunit "XML Import Process" ; + begin + if not FileMgt.GetFilesList(ImportFolderID, temp_CloudStorage) then + exit; + + if temp_CloudStorage.FindSet() then + repeat + TempBlob.CreateInStream(_InStream); + TempBlob.CreateOutStream(OStream); + CloudStorageManagement.DownloadServerFile(temp_CloudStorage, TempBlob, ServerFileName); + + if XMLImportProcess.ProcessFileImport(_InStream) then + if ArchiveFolderID <> '' then + FileMgt.MoveFileToFolderWithID(temp_CloudStorage, ArchiveFolderID); + until temp_CloudStorage.Next() = 0; + end; + ``` \ No newline at end of file diff --git a/Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al b/Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al index 3e41cac..27c7fd1 100644 --- a/Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al +++ b/Cloud File Mgt/src/Sharepoint/PTESharepointFolders.Table.al @@ -1,7 +1,7 @@ table 80400 "PTE Sharepoint Folders" { DataClassification = SystemMetadata; - + Caption = 'Sharepoint Folders'; fields { field(1; CODE; Code[20]) From 1aa22f51030c4100aff0031fa7ecb25da625b810 Mon Sep 17 00:00:00 2001 From: Kasper Lind Date: Mon, 15 Dec 2025 11:10:54 +0100 Subject: [PATCH 5/5] remove error if folder is empty --- Cloud File Mgt/app.json | 2 +- Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cloud File Mgt/app.json b/Cloud File Mgt/app.json index bd1088e..607742f 100644 --- a/Cloud File Mgt/app.json +++ b/Cloud File Mgt/app.json @@ -2,7 +2,7 @@ "id": "2051d42a-342f-4d28-9b3e-ed86d590a40f", "name": "Cloud File Mgt", "publisher": "PrintVis A/S", - "version": "1.0.0.3", + "version": "1.0.0.4", "brief": "", "description": "", "privacyStatement": "", diff --git a/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al b/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al index d49e86b..9d74526 100644 --- a/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al +++ b/Cloud File Mgt/src/Sharepoint/PTEFileMgtSharepoint.Codeunit.al @@ -89,7 +89,7 @@ codeunit 80400 "PTE File Mgt Sharepoint" temp_CloudStorage_.SetRange(type, temp_CloudStorage_.type::File); temp_CloudStorage_.SetFilter(Name, '<>%1|<>%2', '', '.'); if not temp_CloudStorage_.FindSet() then - error('is empty, please check setup / sharepoint'); + exit; repeat CloudStorage_Out := temp_CloudStorage_; CloudStorage_Out.Insert();