icFrom | input | character | The login who has sent this message. |
icTo | input | character | The user to which the message must be sent. |
icCc | input | character | The comma separated list of users to which the message should be sent |
icBcc | input | character | Blind copy |
icSubject | input | character | The subject of the message to be created. |
icContent | input | character | The content of the message. |
icGuid | input | character | Guid for the external message. If not passed, the guid is calculated by the method itself. |
icContentType | input | character | Content type: Can be "text/plain" or "text/html". Default is "text/plain". |
oiReturnStatus | output | integer | Return status of the method. |
/* ================================================================= */ /* Copy the input dataset to the right dataset expected by the */ /* backend. */ /* ================================================================= */ if icGuid = "" or icGuid = ? then do : vaUuid = GENERATE-UUID. assign icGuid = GUID(vaUuid). end. if icContentType = "" or icContentType = ? then assign icContentType = "text/html":U. empty temp-table ttMessage. assign vhIn = ? vhOut = ? vhInOut = dataset dsMessage:handle. Create Dataset vhIn in widget-pool "non-persistent". Create dataset vhOut in widget-pool "non-persistent". create ttMessageQueue. assign ttMessageQueue.queueName = "Inbox":U. set-size(vmContent) = length(icContent,"RAW":U) + 1. put-string(vmContent,1) = icContent. create ttMessage. assign ttMessage.msgGuid = icGuid ttMessage.msgParentGuid = "" ttMessage.msgFrom = icFrom ttMessage.msgTo = icTo ttMessage.msgCc = icCc ttMessage.msgBcc = icBcc ttMessage.msgSubject = icSubject ttMessage.msgDateCreated = now ttMessage.msgContentType = icContentType. /* Use copy-lob statement instead of a normal assign statement because it results in an unusable temp-table with OE version 10.1C01 */ copy-lob vmContent to ttMessage.msgContent. <M-2 run CallStandAloneService (input ? (icExternalProcedureDispatcher), input 'com/qad/shell/inbox/UpdateMessages_a.p':U (icExternalProcedureService), input vhIn by-reference (izInput), input-output vhInOut by-reference (bzInputOutput), input-output vhOut by-reference (bzOutput), output viFcReturnSuper (oiReturnStatus)) in PWorkInbox> If viFcReturnSuper <> 0 Then Assign oiReturnStatus = viFcReturnSuper. If viFcReturnSuper < 0 Then Return. finally: set-size(vmContent) = 0. if vhIn <> ? then delete object vhIn. if vhOut <> ? then delete object vhOut. end finally.