Wednesday 26 April 2017

Joins For selecting corresponding InvoiceId based on Vocher for a vendor

static void VoucherInvoice(Args _args)
{
    LedgerJournalTrans      ledgerJournalTrans;
    VendTrans               vendTrans;
    VendInvoiceJour         vendInvoiceJour;

    select  ledgerJournalTrans  where   ledgerJournalTrans.Voucher == "APIN000002"
                                 join    vendTrans   where   ledgerJournalTrans.VendTransId  ==  vendTrans.RecId
        join    vendInvoiceJour where   vendInvoiceJour.LedgerVoucher == vendTrans.Voucher

                                 &&  vendTrans.AccountNum   ==  vendInvoiceJour.InvoiceAccount
                                   &&  vendTrans.TransDate   ==  vendInvoiceJour.InvoiceDate;
    //CW0129

    info(strFmt("%1",vendInvoiceJour.InvoiceId));

}

No comments:

Post a Comment