project BLF > class TDocumentLink > method CopyDocumentAttachments

Description

Copy all document attachments of an existing business object to a new business object. Any existing document attachments on the new business object will be removed.


Parameters


icComponentNameinputcharactername of the business component
(can be found in vcFcComponentName)
iiFromCompanyIDinputintegerin case the parent object is scoped to a single company, give the ID of the company that it is created in
iiFromSharedSetIDinputintegerin case the parent object is scoped to a shared set, give the ID of the shared set that it is created in
icFromParentObjectKeyinputcharactergive an identification for the parent object
iiToCompanyIDinputintegerin case the parent object is scoped to a single company, give the ID of the company that it is created in
iiToSharedSetIDinputinteger
icToParentObjectKeyinputcharactergive an identification for the parent object
ocResponseoutputcharacterResponse will be empty when the operation was succesful


Internal usage


unused


program code (program1/tdocumentlink.p)

/* copy nothing if no documents exist */
<M-72 run CollectionExists
   (input  vcWebdavRoot + 'attachments/' + icComponentName + '/' + string(iiFromCompanyID) + '/' + string(iiFromSharedsetID) + '/' + icFromParentObjectKey (icPath), 
    output vlExists (olExists)) in TDocumentLink>
if not vlExists
then return.

<M-54 run CopyResource
   (input  'attachments/' + icComponentName + '/' + string(iiFromCompanyID) + '/' + string(iiFromSharedsetID) + '/' + icFromParentObjectKey (icCreatePath), 
    input  'attachments/' + icComponentName + '/' + string(iiToCompanyID) + '/' + string(iiToSharedsetID) + '/' + icToParentObjectKey (icCopyPath), 
    output ocResponse (ocResponse)) in TDocumentLink>