project BLF > class PDocumentLink > method RegisterAttachment

Description

register a document attachment created in the webdav store


Parameters


icAppIDinputcharacter
icContextinputcharacter
icPrograminputcharacter
icFieldNameinputcharacter
icFieldValueinputcharacter
icFileNameinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method TDocumentLink.CreateDocumentAttachment


program code (program1/pdocumentlink.p)

empty temp-table ttAttachmentArea.
empty temp-table ttAttachments.
empty temp-table ttTags.

create ttAttachmentArea.
assign ttAttachmentArea.docd_app_id      = icAppID
       ttAttachmentArea.docd_context     = icContext
       ttAttachmentArea.docd_program     = icProgram
       ttAttachmentArea.docd_field_name  = icFieldName
       ttAttachmentArea.docd_field_value = icFieldValue.

create ttAttachments.
assign ttAttachments.action           = "CREATE"
       ttAttachments.docd_app_id      = icAppID
       ttAttachments.docd_context     = icContext
       ttAttachments.docd_program     = icProgram
       ttAttachments.docd_field_name  = icFieldName
       ttAttachments.docd_field_value = icFieldValue
       ttAttachments.doc_filename     = icFileName
       ttAttachments.doc_title        = icFileName
       ttAttachments.doc_location     = "attachments/"
                                      + icContext + "/"
                                      + icProgram + "/"
                                      + icFieldName + "/"
                                      + icFieldValue.

assign vhIn    = dataset dsAttachmentRequest:handle
       vhOut   = dataset dsAttachmentResponse:handle.
Create Dataset vhInOut in widget-pool "non-persistent".

<M-81 run CallStandAloneService
   (input  ? (icExternalProcedureDispatcher), 
    input  'com/qad/shell/interface/AttachmentUpdate_a.p':U (icExternalProcedureService), 
    input  vhIn by-reference (izInput), 
    input-output vhInOut by-reference (bzInputOutput), 
    input-output vhOut by-reference (bzOutput), 
    output oiReturnStatus (oiReturnStatus)) in PDocumentLink>

finally:
    if vhInOut <> ?
    then delete object vhInOut.
end finally.