PdcSharepoint.SearchFileInDirectory: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
== Declaration ==
== Declaration ==
SearchFileInDirectory(intDirectoryType As Integer, intPID as Integer, strSubDirectory as String) As [[SharepointFileInfo]]
SearchFileInDirectory(intDirectoryType As Integer, intPID as Integer, strSubDirectory as String, strFilename as String) As [[SharepointFileInfo]]


== Description ==
== Description ==
Line 6: Line 6:
* 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.
* 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 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. <br>
If successful, the result will contain a [[SharepointFileInfo]] from which the file can be accessed. <br>
Line 14: Line 15:
<source lang="vb">
<source lang="vb">
Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("sharepointHoofdMap")
Dim sp As PDCEXT.PdcSharepoint = PDC.App.Sharepoint("sharepointHoofdMap")
Dim sharepointFile As ISharepointFileInfo = sp.SearchFileInDirectory(12, 633, "", "invoices\October")
Dim sharepointFile As ISharepointFileInfo = sp.SearchFileInDirectory(12, 633, "invoices\October", "salesInvoice.pdf")
If Not IsNothing(sharepointFile ) Then
If Not IsNothing(sharepointFile ) Then
     MsgBox(spFileInfo.FileName)
     MsgBox(spFileInfo.FileName)

Latest revision as of 12:29, 14 October 2024

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