VI Perform Logic for AP Invoice Duplicates - Sage100 Business Framework (v2014)

Hello -

I am looking for someone to be so kind as to post the syntax for Perform Logic to look for already posted duplicate A/P invoices during VI.  I used perform logic in the past (non-framework) but do not know what the current syntax should be.

Unfortunately I could not get assistance with Sage directly for this even though I truly think that this should already be part of the logic since it is when keying.

This is really useful logic and I feel would be beneficial to many people in the community.

Thank you!

  • 0

    Here is the perform logic for preventing AP invoice records from import. This checks the invoice history file for existing invoices (Div+VendorNo+InvoiceNo) and was developed by Alnoor Cassim for v4.30 but still works for 2017.

    Step 1: copy the text below into notepad and save the file as "AP_VISkipDuplicateInvoices.m4p"

    Step2: place file AP_SkipDuplicateInvoices.m4p into the AP directory

    Step3: add VI perform logic as follows:

       JobName: (whatever your VI job name is)

       Perform Type: Before Assign

       File Type: Header

       Table Name: AP_InvoiceHeader

       Column Name: InvoiceNo

       Sequence: 001

       Command:  ..\AP\AP_VISkipDuplicateInvoices.m4p;ENTRY_POINT

    ----- copy the text below into notepad and name the file AP_VISkipDuplicateInvoices.m4p --------

    ! In V/I Import Job set the PERFORM to run on 
    ! BEFORE ASSIGN of Header on table AP_InvoiceHeader column InvoiceNo
    ! Command = ..\AP\AP_VISkipDuplicateInvoices.m4p;ENTRY_POINT

    ENTRY_POINT:
    IF NOT(coInvcHistHdr) THEN {
    coInvcHistHdr = NEW("AP_InvoiceHistoryHeader_Svc",%SYS_SS)
    }

    InvoiceNo$ = VAR$

    retExists =coInvcHistHdr'CheckInvoiceHistory(APDivisionNo$, VendorNo$, InvoiceNo$)

    IF retExists THEN { VAR$=$$ }

    EXIT