PdcSharepoint.FileListViaRelativePath: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == FileListViaRelativePath(intDirectoryType As Integer, intPID as Integer, strSubDirectory as String) As SharepointFileInfoList == Description == * The parameter intDirectoryType indicates a number which provides context regarding the entity. This number corresponds to an entity type, for example Companies or Calculations. See DirectoryTypes for more information. * The parameter intPID is the unique _pid value that each record in the database has...."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:


== Description ==
== Description ==
This function will return a list of files that are in a specific directory. The relative path to this directory is determine by the DirectoryType and Pid, but using the SubDirectory parameter you can go even deeper.
* The parameter intDirectoryType indicates a number which provides context regarding the entity. This number corresponds to an entity type, for example Companies or Calculations. See [[DirectoryTypes]] for more information.
* The parameter intDirectoryType indicates a number which provides context regarding the entity. This number corresponds to an entity type, for example Companies or Calculations. See [[DirectoryTypes]] for more information.
* The parameter intPID is the unique _pid value that each record in the database has. This pid is used to determine which folder needs to be searched for within Sharepoint.
* The parameter intPID is the unique _pid value that each record in the database has. This pid is used to determine which folder needs to be searched for within Sharepoint.
Line 14: Line 16:
<source lang="vb">
<source lang="vb">
Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("scriptUploadLocation")
Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("scriptUploadLocation")
Dim spFileInfoList As PDCEXT.SharepointFileInfoList = sp.SearchFilesStartingWithName("Beme")
Dim spFileInfoList As PDCEXT.SharepointFileInfoList = sp.FileListViaRelativePath(2, 68, "invoices")
If Not IsNothing(spFileInfoList) Then
If Not IsNothing(spFileInfoList) Then
     For i As Integer = 0 To spFileInfoList.Count - 1
     For i As Integer = 0 To spFileInfoList.Count - 1
Line 24: Line 26:


== Availability ==
== Availability ==
Available since 2021R4
Available since 2024R4

Latest revision as of 12:16, 22 July 2024

Declaration

FileListViaRelativePath(intDirectoryType As Integer, intPID as Integer, strSubDirectory as String) As SharepointFileInfoList

Description

This function will return a list of files that are in a specific directory. The relative path to this directory is determine by the DirectoryType and Pid, but using the SubDirectory parameter you can go even deeper.

  • The parameter intDirectoryType indicates a number which provides context regarding the entity. This number corresponds to an entity type, for example Companies or Calculations. See DirectoryTypes for more information.
  • The parameter intPID is the unique _pid value that each record in the database has. This pid is used to determine which folder needs to be searched for within Sharepoint.
  • The parameter strSubDirectory is for any subdirectory within the main directory. For example if the directory structure is like this: 'Companies\00211 - AHREND [68]\invoices\October', you can fill in the strSubDirectory parameter with 'invoices\October' to search within the oktober subdirectory.

If successful, the result will contain a SharepointFileInfoList from which all the files can be accessed. This list includes files and directories, via the property IsDirectory you can determine what the file is.
If unsuccessful, the result is nothing

Code example

Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("scriptUploadLocation")
Dim spFileInfoList As PDCEXT.SharepointFileInfoList = sp.FileListViaRelativePath(2, 68, "invoices")
If Not IsNothing(spFileInfoList) Then
    For i As Integer = 0 To spFileInfoList.Count - 1
        Dim spFileInfo As PDCEXT.SharepointFileInfo = spFileInfoList.Items(i)
        MsgBox(spFileInfo.FileName)
    Next
End If

Availability

Available since 2024R4