project QadFinancials > class BMfgCustomer > method GetAddressTypeId

Description

Get Head Office address type ID


Parameters


oiHeadOfficeAddressTypeIdoutputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BMfgCustomer.ApiReplicateFromFinancials


program code (program9/bmfgcustomer.p)

<Q-33 run AddressTypeByCode (all) (Read) (NoCache)
   (input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressTypeCode)
    output dataset tqAddressTypeByCode) in BAddressType >
    
find first tqAddressTypeByCode where
           tqAddressTypeByCode.tcAddressTypeCode = {&ADDRESSTYPECODESYSTEM-HEADOFFICE}
           no-error.
if not available tqAddressTypeByCode
then do:
    assign vcMessage = #T-91'The Head Office address type is not defined in the system.':100(49190)T-91#.
    <M-35 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-588156':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BMfgAddress>
    assign oiReturnStatus = -1.
    leave.
end.      

assign oiHeadOfficeAddressTypeId = tqAddressTypeByCode.tiAddressType_ID.