Parameters
ihResultTT | input | handle | |
icCOACrossRefCode | input | character | |
icAltFieldName | input | character | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program7/baccountinginterface.p)
/*
* Call the method GetCOACrossRef to do validation.
* Then populate the result temp-table with Alternate code and description.
*/
if icCOACrossRefCode <> "" and icCOACrossRefCode <> ?
then do:
if viBCOACrossRef7ID = ? or
viBCOACrossRef7ID = 0
then do:
<I-1 {bFcStartAndOpenInstance
&ADD-TO-TRANSACTION = "false"
&CLASS = "BCOACrossRef"}>
end.
else do:
<I-2 {bFcOpenInstance
&CLASS = "BCOACrossRef"}>
end.
empty temp-table tCOACrossRefDetEmpty.
<M-4 run GetCOACrossRef
(input viDomainID (iiSourceDomainID),
input icCOACrossRefCode (icCOACrossRefCode),
input ? (iiCOACrossRefID),
input {&COACROSSREFTYPE-ALTERNATE} (icCOACrossRefType),
input tCOACrossRefDetEmpty (tApiCOACrossRefDet),
input false (ilSkipMessages),
input-output tCOACrossRefDetInfo (tCOACrossRefResult),
output viFcReturnSuper (oiReturnStatus)) in BCOACrossRef>
<I-3 {bFcCloseInstance
&CLASS = "BCOACrossRef"}>
if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus >= 0)
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0 then return.
create query vhQueryTemp in widget-pool "non-persistent".
vhQueryTemp:set-buffers(ihResultTT).
vhQueryTemp:query-prepare("for each ":U + ihResultTT:table).
vhQueryTemp:query-open().
vhQueryTemp:get-first().
do while not vhQueryTemp:query-off-end:
find first tCOACrossRefDetInfo where
tCOACrossRefDetInfo.tcGLCode = ihResultTT:buffer-field(icAltFieldName):buffer-value no-error.
if available tCOACrossRefDetInfo
then do:
assign ihResultTT:buffer-field(icAltFieldName):buffer-value = tCOACrossRefDetInfo.tcTargetAltCOAStructDetCode.
end. /* if available tCOACrossRefDet */
vhQueryTemp:get-next().
end. /* do while not vhQueryTemp:query-off-end */
vhQueryTemp:query-close().
delete object vhQueryTemp.
end. /* if vcCOACrossRefCode <> "" and vcCOACrossRefCode <> ? */