| icComponentName | input | character | name of the business component (can be found in vcFcComponentName) |
| iiCompanyID | input | integer | in case the parent object is scoped to a single company, give the ID of the company that it is created in |
| iiSharedsetID | input | integer | in case the parent object is scoped to a shared set, give the ID of the shared set that it is created in |
| icParentObjectKey | input | character | give an identification for the parent object |
| icResourceName | input | character | name of the resource to create |
| icFileName | input | character | use file name when the data to send to webdav is stored on the file system |
| imFileContent | input | memptr | use file content in case the data to send to webdav is stored in memory |
| ocResponse | output | character | Response will be empty when the operation was succesful |
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"}>