project QadFinancials > class BAPMatching > method LoadMatchingPosting

Description

This method reads matching posting if available


Parameters


iiPostingIdinputinteger
oiInstanceJournalEntryIdoutputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program7/bapmatching.p)

/* validate input paramters */
    if iiPostingId = 0 or
       iiPostingId = ?
    then return.

    assign oiReturnStatus = -98.
    
    /* open instance of JournalEntry component */
    if viBJournalEntryAPMID = 0 or
       viBJournalEntryAPMID = ?
    then do:
        <I-1 {bFcStartAndOpenInstance
            &ADD-TO-TRANSACTION = "true"
            &CLASS              = "BJournalEntry"}>
        assign vlBJournalEntryStart = true.
    end.
    else do:
        <I-2 {bFcOpenInstance
            &CLASS           = "BJournalEntry"}>
    end.
    
    /* load data of posting from database */
    <M-6 run DataLoad
       (input  ? (icRowids), 
        input  string(iiPostingId) (icPkeys), 
        input  ? (icObjectIds), 
        input  ? (icFreeform), 
        input  yes (ilKeepPrevious), 
        output viFcReturnSuper (oiReturnStatus)) in BJournalEntry>

    
    /* close instance of JournalEntry component */
    <I-4 {bFcCloseInstance
            &CLASS           = "BJournalEntry"}>
    
    /* return */
    assign oiInstanceJournalEntryId = viBJournalEntryAPMID.
    if oiReturnStatus = -98 then assign oiReturnStatus = 0.