PdcSharepoint.SearchFileInDirectory

From External Bemet Wiki
Revision as of 12:29, 14 October 2024 by TC (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Declaration

SearchFileInDirectory(intDirectoryType As Integer, intPID as Integer, strSubDirectory as String, strFilename as String) As SharepointFileInfo

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. 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.
  • The parameter strFilename is the name of the file to be searched within the directory(and subdirectories)

If successful, the result will contain a SharepointFileInfo from which the file can be accessed.
If unsuccessful, the result is nothing

Code example

Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("sharepointHoofdMap")
Dim sharepointFile As ISharepointFileInfo = sp.SearchFileInDirectory(12, 633, "invoices\October", "salesInvoice.pdf")
If Not IsNothing(sharepointFile ) Then
    MsgBox(spFileInfo.FileName)
End If

Availability

Available since 2024R4