The attached scenario will save all attachments in Incidents to a local folder.
Before running it You must configure the connector to Your environment. You also need to modify the mapping to suit Your needs of filenaming.
The scenario is designed for incidents but can easily be changed for any other files. Just change the select criteria on the sc connector. And change the filenaming in the script.Code:Dim iItem as Integer Dim iCount as Integer Dim sFiles as String sFiles ="" iCount = pifGetItemCount("attachments") For iItem = 0 to iCount - 1 iRc=pifWriteBlobInFile("attachments(" & iItem & ").attachment", "d:\temp\attachments\IM\IM" & [number] & " " & iItem & " " & [attachments(iItem).name]) sFiles = sFiles & ";" & "d:\temp\attachments\IM\IM" & [number] & " " & iItem & " " & [attachments(iItem).name] Next RetVal = [number] & " Attachments#: " & iCount & " Filenames: " & sFiles
The script will also output a text file listing all the attachments for each incident written.



Reply With Quote


Bookmarks