project QadFinancials > class BMfgSystemAccountControl > method UpdateMfgData

Description

Controls the processing of any update logic that is required when performing a create/modfiy operation on an MFG/PRO business component.
KEEP THE ANCESTOR TAG IN THE DESCENDANTS TO AVOID SCOPING PROBLEMS ON THE RECORD-AVAILABILITY
This method is the place holder for nay update ligic and complex mapping from the financials table to MFG/PRO.


Parameters


icMfgTableNameinputcharacterName of the MFG/PRO table name that is currently being processed. This is used to determine which logic to execute within the method in the cases where one business component maps to multiple tables in MFG/PRO.
icFinancialTableNameinputcharacterName of the Financial table name that is currently being processed. This is used to determine which logic to execute within the method in the cases where one business component has multiple tables that map to MFG/PRO.
ihFinancialDataBufferinputhandle
ihMfgDataBufferinputhandle
icMfgDomaininputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program/bmfgsystemaccountcontrol.p)

<ANCESTOR-CODE>

find tCopyDomainPropertyRefC where tCopyDomainPropertyRefC.Domain_ID = tCopyDomainRef.Domain_ID no-error.

if available tCopyDomainPropertyRefC then do:

    if tgl_ctrl.gl_base_curr <> tCopyDomainPropertyRefC.tcCurrencyCode then
        assign
            tgl_ctrl.gl_base_curr = tCopyDomainPropertyRefC.tcCurrencyCode
            tgl_ctrl.tc_Status = 'C':U when tgl_ctrl.tc_Status = '':U.

    <Q-2 run CurrencyByCurrRoundingMethod (all) (Read) (NoCache)
       (input ?, (CurrencyID)
        input tCopyDomainPropertyRefC.tcCurrencyCode, (CurrencyCode)
        input ?, (RoundingMethodCode)
        output dataset tqCurrencyByCurrRoundingMethod) in BCurrency >                                        
    
    find first tqCurrencyByCurrRoundingMethod no-error.

    if not available tqCurrencyByCurrRoundingMethod then do:

        assign 
            vcMessageText  = trim(#T-1'The currency with the key $1 does not exist.':100(48939)t-1#)
            oiReturnStatus = -3.

        <M-3 run SetMessage
           (input  vcMessageText (icMessage), 
            input  tCopyDomainPropertyRefC.tcCurrencyCode (icArguments), 
            input  '' (icFieldName), 
            input  '' (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '' (icRowid), 
            input  'QadFin-7152':U (icFcMsgNumber), 
            input  '' (icFcExplanation), 
            input  '' (icFcIdentification), 
            input  '' (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BMfgSystemAccountControl>

        return.
    end.

    if tgl_ctrl.gl_rnd_mthd <> tqCurrencyByCurrRoundingMethod.tcRoundingMethodCode then
        assign
            tgl_ctrl.gl_rnd_mthd = tqCurrencyByCurrRoundingMethod.tcRoundingMethodCode
            tgl_ctrl.tc_Status = 'C':U when tgl_ctrl.tc_Status = '':U.

end.