PdcAttachmentList.ReadFromTableName

From External Bemet Wiki
Revision as of 11:11, 29 November 2023 by TC (talk | contribs)
Jump to navigation Jump to search

Declaration

ReadFromTableName(tableName as String, Id as string) as Boolean

Description

This function will read the attachments based on the TableName and Id string.

When reading attachments from Sharepoint, it will include a full path towards the file. If the user has a local sharepoint folder, it will return the path to the file inside this local folder.
If there is no local sharepoint folder, it will download a copy of the attachment to the Bemet temp directory, and include the full path towards this file.

If sharepoint is not used, it will always copy the attachment to the Bemet temp directory, and only include the filename without the full path.

Notes

Code example

This example loads all attachments related to calculationnumber 12345

Dim attachmentlist As PDCEXT.PdcAttachmentList = PDC.App.AttachmentList
if attachmentlist.ReadFromTableName("DO_CALC", "12345") then
  if attachmentlist.Count > 0 then
    For index = 0 to attachmentlist.count - 1
      Dim attachment as PDCEXT.PDCAttachment = attachmentlist.Items(index)
    Next
  end if
end if

Availability

Changed in 2022 R3