PdcAttachmentList.Read: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Declaration ==
== Declaration ==
Read(tableName, keyStr, Id: string) as Boolean
Read(tableName as String, keyStr as String, Id as string) as Boolean


== Description ==
== Description ==
Line 10: Line 10:


== Code example ==
== Code example ==
 
This example loads all attachments related to calculationnumber 12345
<source lang="vb.Net">
<source lang="vb.Net">
Dim attachmentlist As pdcEXT.PdcAttachmentList = PDC.App.AttachmentList
Dim attachmentlist As PDCEXT.IPdcAttachmentList = PDC.App.AttachmentList
if attachmentlist.Read("DO_CALC", "", "12345") then
if attachmentlist.Read("DO_CALC", "", "12345") then
   if attachmentlist.Count > 0 then
   if attachmentlist.Count > 0 then
     For index = 0 to attachmentlist.count - 1
     For index = 0 to attachmentlist.count - 1
       Dim attachment as PDCEXT.PDCAttachment = attachmentlist.Items(index)
       Dim attachment as PDCEXT.IPDCAttachment = attachmentlist.Items(index)
     Next
     Next
   end if
   end if

Latest revision as of 12:55, 28 November 2023

Declaration

Read(tableName as String, keyStr as String, Id as string) as Boolean

Description

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

Notes

The keyStr is not used but remains as we have encountered issues in the past by changing the parameters of functions. The keyStr parameter can therefor be entered as empty like in the code example.

Code example

This example loads all attachments related to calculationnumber 12345

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

Availability

Changed in 2022 R3