project BLF > class PMfgPro > method GetExceptionMessageFromSINumber

function returns character

Description

Converts the "QAD-<nbr>" and "OE-<nbr>" string into a more meaningful message that can be stored in the tFcMessages table.
With this function, a specific service might add or overrride default messages as a translation of the "QAD-<nbr>". Best is to put this code before the <ANCESTOR> tag.


Parameters


icQadNbrinputcharacter
icQadDescinputcharacter
icQadContextinputcharacter
icQadDatainputcharacter
icQadFieldinputcharacter
icQadIndexinputcharacter
icQadSevinputcharacter


Internal usage


BLF
method PMfgPro.StoreSIExceptions


program code (program1/pmfgpro.p)

/* How should we translate these messages?  Apparently MfgPro uses the include pxsevcon.i
   for the definition of "severity" codes, which are linked to the following:

   /*Error exception handling and message CONSTANTS*/
   &GLOBAL-DEFINE SUCCESS-RESULT '0'
   &GLOBAL-DEFINE INFORMATION-RESULT '1'
   &GLOBAL-DEFINE WARNING-RESULT '2'
   &GLOBAL-DEFINE APP-ERROR-RESULT '3'
   &GLOBAL-DEFINE APP-ERROR-NO-REENTER-RESULT '4'  /*same as APP-ERROR-RESULT*/

   /*Standard Exceptions CONSTANTS*/
   &GLOBAL-DEFINE GENERAL-APP-EXCEPT '7'
   &GLOBAL-DEFINE SYSTEM-EXCEPTION '7'
   &GLOBAL-DEFINE SYSTEM-ERROR-RESULT '8'
   &GLOBAL-DEFINE INFRASTRUCTURE-EXCEPTION '8'   

   /*Generic Application CONSTANTS*/
   &GLOBAL-DEFINE RECORD-NOT-FOUND '100'
   &GLOBAL-DEFINE RECORD-FOUND '101'
   &GLOBAL-DEFINE EXCLUSIVE-LOCK '102'
   &GLOBAL-DEFINE NO-LOCK '103'
   &GLOBAL-DEFINE RECORD-LOCKED '104'
   &GLOBAL-DEFINE RECORD-NOT-PROCESSED '105'
   &GLOBAL-DEFINE LOCK_FLAG true
   &GLOBAL-DEFINE NO_LOCK_FLAG false
   &GLOBAL-DEFINE WAIT_FLAG true
   &GLOBAL-DEFINE NO_WAIT_FLAG false

   /* Infrastructure CONSTANTS  */
   &GLOBAL-DEFINE SYSTEM-MSG '-1'
   &GLOBAL-DEFINE SUPPRESS-MSG '-2'

   /* Delimiter constants */
   &GLOBAL-DEFINE REC-DELIM "."
   &GLOBAL-DEFINE DELIM-0 chr(1)
   &GLOBAL-DEFINE DELIM-1 chr(2)
   &GLOBAL-DEFINE DELIM-2 chr(3)
   &GLOBAL-DEFINE DELIM-3 chr(4)
   &GLOBAL-DEFINE DELIM-4 chr(5)
   &GLOBAL-DEFINE DELIM-5 chr(6)
   &GLOBAL-DEFINE DELIM-6 chr(7)

   &GLOBAL-DEFINE DYNAMIC-QUERY-EXP '<CREATEQUERYFOREXPRESSION>'   
**/

If icQadNbr Begins "OE-"
Then Do: 
    Assign vcMessage = icQadDesc + chr(10) +
                         "tt_msg_sev     = " + icQadSev + chr(10) +
                         "tt_msg_nbr     = " + icQadNbr + chr(10) +
                         "tt_msg_data    = " + icQadData + chr(10) +
                         "tt_msg_context = " + icQadContext + chr(10) +
                         "tt_msg_field   = " + icQadField + chr(10) +
                         "tt_msg_index   = " + icQadIndex.
    Return vcMessage.
End.                         

case trim(icQadNbr):
    when "QRA-1":U
    then assign vcMessage = #T-1'The referenced service dataset is not available:':100(8081)T-1# + icQadDesc.
    when "QRA-3":U
    then assign vcMessage = #T-2'Configuration file not found (this is server.xml)':100(8855)T-2#.
    when "QRA-36":U
    then assign vcMessage = #T-3'Service settings not found (generally, incorrect or missing entries in server.xml)':100(8856)T-3#.
    when "QRA-33":U
    then assign vcMessage = #T-4'Service instance settings not found (generally, incorrect or missing entries in server.xml)':130(8857)T-4#.
    when "QRA-2":U
    then assign vcMessage = #T-5'Could not connect to AppService':50(8072)T-5#.
    when "QRA-5":U
    then assign vcMessage = #T-6'Could not connect to Web Service':100(8075)T-6#.
    when "QRA-6":U
    then assign vcMessage = #T-7'Could not start Web Service':100(8076)T-7#.
    when "QRA-37":U
    then assign vcMessage = #T-8'Service instance is available (ping reply).':50(8077)T-8#.
    otherwise assign vcMessage = icQadDesc + chr(10) +
                                 "tt_msg_sev     = " + icQadSev + chr(10) +
                                 "tt_msg_nbr     = " + icQadNbr + chr(10) +
                                 "tt_msg_data    = " + icQadData + chr(10) +
                                 "tt_msg_context = " + icQadContext + chr(10) +
                                 "tt_msg_field   = " + icQadField + chr(10) +
                                 "tt_msg_index   = " + icQadIndex.
end case.

return vcMessage.