PdcAttachment.TempFilePath

From External Bemet Wiki
Jump to navigation Jump to search

Declaration

TempFilePath as String

Description

If the attachment has already been downloaded to a temp file, for example while loading the attachment from Bemet, the path to this location is stored in this property. This property can also filled with the location of a file, and then the file at this location will be used in the save.

Notes

Code example

Adding a local file to Bemet

Dim calcAttachList As PDCEXT.IPdcAttachmentList = PDC.App.AttachmentList
calcAttachList.ReadFromTableName("DO_CALC", tbCalcNr.Text)

Dim newAttach As PDCEXT.IPdcAttachment = calcAttachList.Add()
newAttach.FileName = "NewFile.pdf"
newAttach.TempFilePath = "C:\AFolder\NewFile.pdf"
newAttach.Save("")


Copying all attachments of a calculation to a sales invoice

Dim calcAttachList As PDCEXT.IPdcAttachmentList = PDC.App.AttachmentList
calcAttachList.ReadFromTableName("DO_CALC", tbCalcNr.Text)

Dim invAttachList As PDCEXT.IPdcAttachmentList = PDC.App.AttachmentList
invAttachList.ReadFromTableName("FACTUUR", tbInvNr.Text)

For attachIndex As Integer = 0 To calcAttachList.Count - 1
    Dim attachment = calcAttachList.Items(attachIndex)

    Dim copyAttachment As PDCEXT.IPdcAttachment = invAttachList.Add
    copyAttachment.FileName = attachment.FileName
    copyAttachment.TempFilePath = attachment.TempFilePath
    copyAttachment.Save("")
Next


Availability

Bemet 2024R1