project BLF > class TDocumentLink > method CreateDocumentAttachment

Description

create a document attachment for any business object


Parameters


icComponentNameinputcharactername of the business component
(can be found in vcFcComponentName)
iiCompanyIDinputintegerin case the parent object is scoped to a single company, give the ID of the company that it is created in
iiSharedsetIDinputintegerin case the parent object is scoped to a shared set, give the ID of the shared set that it is created in
icParentObjectKeyinputcharactergive an identification for the parent object
icResourceNameinputcharactername of the resource to create
icFileNameinputcharacteruse file name when the data to send to webdav is stored on the file system
imFileContentinputmemptruse file content in case the data to send to webdav is stored in memory
ocResponseoutputcharacterResponse will be empty when the operation was succesful


Internal usage


unused


program code (program1/tdocumentlink.p)

define variable oireturnstatus as integer no-undo.

<M-76 run CreateResource
   (input  'attachments/' + icComponentName + '/' + string(iiCompanyID) + '/' + string(iiSharedsetID) + '/' + icParentObjectKey (icCollection), 
    input  icResourceName (icResource), 
    input  icFileName (icFileName), 
    input  imFileContent (imFileContent), 
    output ocResponse (ocResponse)) in TDocumentLink>

<I-72 {tFcStartAndOpenInstance
     &CLASS                = "PDocumentLink"
     &SESSIONID            = "viWebdavSessionId"}>
<M-4 run RegisterAttachment
   (input  'MFG' (icAppID), 
    input  icComponentName (icContext), 
    input  string(iiCompanyID) (icProgram), 
    input  string(iiSharedsetID) (icFieldName), 
    input  icParentObjectKey (icFieldValue), 
    input  icResourceName (icFileName), 
    output viFcReturnSuper (oiReturnStatus)) in PDocumentLink>
<I-45 {tFcCloseAndStopInstance
     &CLASS           = "PDocumentLink"}>