project QadFinancials > class BDDocument > method SetMessage

Description

Create a message to send back to the client (either a UI or another application)


Parameters


icMessageinputcharacterThe actual message, can contain $1, $2, ... for values that are situation-dependent.
icArgumentsinputcharacterchr(2) seperated list of values to replace $1, $2, ... in the message with. These values should not be translatable.
icFieldNameinputcharacterOptional name of a business field, to link the message to that field.
icFieldValueinputcharacterOptional value of the business field, converted to string type.
icTypeinputcharacterType of message:
E = user error (incorrect input, this type of error is linked to a business field)
D = database error (other errors)
S = system error (or programming error)
W = warning, results in return status +1 (the transaction can still proceed)
iiSeverityinputintegerError severity level (used to sort the messages on in the error viewer):
1 = critical
2 = high
3 = normal
4 = low
icRowidinputcharacterOptional rowid to link the message to a single record in the class temp-table (mentioned in parameter icFieldName).
Refers to the field tc_Rowid.
icFcMsgNumberinputcharacterA unique number per CB project.
DO NOT CHANGE THIS PARAMETER
icFcExplanationinputcharacterLong description, fully explaining what exactly caused the error or warning, and what has to be done to solve the error/warning involved.
icFcIdentificationinputcharacterIf the error is linked to a specific business object, this field should fully identify this object.
The content of this field is considered to be untranslatable.
icFcContextinputcharacterChange the description of the icContext parameter of the SetMessage method.

Here, the developer can pass extra context information to the end-user that can help him to understand why things went wrong.

This field contains context information, like booleans, data items, result of buffer-compare.
We advise to use the syntax "<Field>=<Value>chr(2)<Field>=<Value>...." as this is recognized by the error viewer.
The content of this field is considered to be untranslatable.
oiReturnStatusoutputinteger


Internal usage


QadFinancials
method BDDocument.AdditionalUpdates
method BDDocument.AdditionalUpdatesGetBankGLInfo
method BDDocument.AdditionalUpdatesGetDeductionJournalCode
method BDDocument.AdditionalUpdatesGetStatusInfo
method BDDocument.AdditionalUpdatesPosting
method BDDocument.AdditionalUpdatesPostingDeduction
method BDDocument.AdditionalUpdatesPostingDocExchangeRate
method BDDocument.AdditionalUpdatesPostingPrePaymentPayCond
method BDDocument.AdditionalUpdatesPostingRounding
method BDDocument.AdditionalUpdatesPostingXref
method BDDocument.AdditionalUpdatesPostingXrefDI
method BDDocument.AdditionalUpdatesPostingXrefDIDisc
method BDDocument.AllocateInvoices
method BDDocument.ApiGetDDocumentInvoiceXrefByDInvDet
method BDDocument.ApiGetDDocumentStatusChange
method BDDocument.ApiSetDDocumentStatusChange
method BDDocument.ApiStdMaintainTT
method BDDocument.ApiStdMaintainTTWithoutAddUpd
method BDDocument.Calculate
method BDDocument.ChangeStatus
method BDDocument.CreateDDocumentHeader
method BDDocument.CreateDDocumentInvoiceXrefsAndStages
method BDDocument.CreateHeaderPayCodeForSel
method BDDocument.DataLoadByInput
method BDDocument.DefaultValuesBankNumber
method BDDocument.DefaultValuesPrepayment
method BDDocument.GetPossibleAllocationsByBank
method BDDocument.IsNewSelectionCodeValid
method BDDocument.PayOrBounceDDocuments
method BDDocument.UpdateDDocument
method BDDocument.ValDocumentStatus
method BDDocument.ValidateComponentDDocumentStatus
method BDDocument.ValidateComponentPost
method BDDocument.ValidateComponentPre
method BDDocument.ValidateComponentPreDebtor
method BDDocument.ValidateComponentPreDInvoice
method BDDocument.ValidateComponentPreInvXrefDI


program code (program/bddocument.p)

/*If the Component is started for batch mode(now only BBankImportLine component start BDDocument in batch mode),
we will use the BBankImportLine.tc_rowid which is passed by Dataload or Adddetailline methods 
to replace the rowid which is passed by SetMessage methods*/

if vlUseExtUniqueIDInDDForSetMsg then
do:
   if icRowid <> "" and icRowID <> ? then
   do:  

      define buffer btDDocument for tDDocument.
      define buffer btDDocInvoiceXrefStage for tDDocInvoiceXrefStage.
      define buffer btDDocumentInvoiceXref for tDDocumentInvoiceXref.
      define buffer btDdocumentPostingLine for tDdocumentPostingLine.
      vlFound = false.

      /*Find record in main class table*/
      for first btDDocument where btDDocument.tc_Rowid = icRowid
          and btDDocument.tcExternalUniqueIdentifier <> "":U and btDDocument.tcExternalUniqueIdentifier <> ?:
         assign
             icFcIdentification = btDDocument.tcExternalUniqueIdentifier
             vlFound = true.
      end.
      
      /*Check the child table tDDocInvoiceXrefStage*/
      if not vlFound then
      do:
         for first btDDocInvoiceXrefStage where btDDocInvoiceXrefStage.tc_Rowid = icRowid,
             first btDDocumentInvoiceXref where btDDocumentInvoiceXref.tc_Rowid = btDDocInvoiceXrefStage.tc_ParentRowid,
             first btDDocument where btDDocument.tc_Rowid = btDDocumentInvoiceXref.tc_ParentRowid
                and btDDocument.tcExternalUniqueIdentifier <> "":U and btDDocument.tcExternalUniqueIdentifier <> ?:
            assign
               icFcIdentification = btDDocument.tcExternalUniqueIdentifier
               vlFound = true.
         end.
      end.

      /*Check the child table tDDocumentInvoiceXref*/
      if not vlFound then
      do:
         for first btDDocumentInvoiceXref where btDDocumentInvoiceXref.tc_rowid = icRowid,
             first btDDocument where btDDocument.tc_Rowid = btDDocumentInvoiceXref.tc_ParentRowid
                and btDDocument.tcExternalUniqueIdentifier <> "":U and btDDocument.tcExternalUniqueIdentifier <> ?:
            assign
               icFcIdentification = btDDocument.tcExternalUniqueIdentifier
               vlFound = true.
         end.
      end.

      /*Check the child table tDDocumentPostingLine*/
      if not vlFound then
      do:
         for first btDDocumentPostingLine where btDDocumentPostingLine.tc_rowid = icRowid,
             first btDDocument where btDDocument.tc_Rowid = btDDocumentPostingLine.tc_ParentRowid
                 and btDDocument.tcExternalUniqueIdentifier <> "":U and btDDocument.tcExternalUniqueIdentifier <> ?:
            assign
               icFcIdentification = btDDocument.tcExternalUniqueIdentifier
               vlFound = true.
         end.
      end.
   end. /*End of if icRowid <> "" and icRowID <> ? then*/
end. /*End of if vlUseExternalUIDInBEForSetMsg then*/

<ANCESTOR-CODE>