PdcAttachmentList.ReadFromTableName: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == ReadFromTableName(tableName as String, Id as string) as Boolean == Description == This function will read the attachments based on the TableName and Id stri..."
 
No edit summary
Line 3: Line 3:


== Description ==
== Description ==
This function will read the attachments based on the TableName and Id string.  
This function will read the attachments based on the TableName and Id string. <br>
<br>
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. <br>
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.<br>
<br>
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 ==
== Notes ==

Revision as of 11:11, 29 November 2023

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