Sage 100 Visual Integrator: Import into AP Manual Check Entry and Suppress Invoices That Do Not Exist in AP_OpenInvoice
A VI import into AP Manual Check Entry cannot compare invoice numbers against AP_OpenInvoice directly. Here is the InvoiceComment technique that skips invoices not on file and logs them for review.
The scenario: a Visual Integrator job imports payment lines into AP Manual Check Entry, and the requirement is "manage by exception" — invoices that already exist in AP_OpenInvoice import normally, invoices that do not exist are skipped, and the skipped ones show in the import log for review.
The obvious design — a condition on the invoice number field comparing it to AP_OpenInvoice — cannot work, for two reasons the platform imposes: a Manual Check Entry import has no link to the Open Invoice file, so there is nothing to compare against; and AP invoice numbers are not unique anyway, since the same invoice number can belong to several vendors. The working design does not compare anything. It lets Sage's own validation flag the new invoices, captures that flag on a field the job can filter, and excludes the flagged lines through the job's selection criteria.
The fix
Sage already detects the condition you care about. When a new invoice number is entered in Manual Check Entry, the line's InvoiceType is set to "A" — during a VI import the "is this a new invoice?" prompt is bypassed, but the InvoiceType is still set the same way. The problem is placement: InvoiceType is assigned only after the invoice number is assigned, which is after any condition on the InvoiceNo field is evaluated, and InvoiceType does not appear in the job's list of available fields, so it cannot be used directly as selection criteria. The solution routes it through the InvoiceComment field:
- In the VI job, map the InvoiceComment field twice.
- Leave the first occurrence as the straight import of the comment from your source file (if your file supplies one).
- Make the second occurrence a calculated field. The calculation retrieves the line's InvoiceType through the business object —
coBusiness'Lines'GetValue("InvoiceType$", ...)into a temporary variable — and uses the TBL function to compare it: if InvoiceType equals "A", the calculation returns the text Invoice Not On File; otherwise it returns the imported InvoiceComment value. - On the job's Select tab, add InvoiceComment to the line selection criteria, set to exclude lines where the comment equals "Invoice Not On File".
- Run the import. Invoices already on file import and pay normally. Invoices not on file fail the selection criteria, are skipped, and appear in the import log — exactly the exception list the reviewer needs.
Options and approaches
LastErrorNum with BOI / calculated fields
When a new invoice number is validated, the Manual Check Entry Lines object also raises the warning identifier AP_ManualCheck_NewInvoice.Y in its LastErrorNum property. If you are comfortable with the Business Object Interface, you can test LastErrorNum for the "NewInvoice" string after the invoice number is set (clearing LastErrorNum before each line, so a previous line's warning does not leak forward), conditionally stamp a marker such as "SKIP" into a text field, and exclude marked lines on the Select tab. It reaches the same result with more moving parts than the InvoiceComment method above.
A pre-write user-defined script
A UDS on the check header's pre-write event can do the lookup properly: read the invoice against AP_OpenInvoice using the table's full key fields (vendor plus invoice number — never the invoice number alone), and fail the record with oScript.SetError when it is not found. Filter the script so it only fires for your VI job, and manual check entry is unaffected. A UDS can also skip the lookup entirely and simply reuse the LastErrorNum warning Sage already sets. This is the most robust option for high-volume or repeated jobs; the trade-off is a script to maintain instead of logic embedded in the job itself.
What doesn't work
- A conditional expression on InvoiceNo comparing AP_ManualCheckDetail to AP_OpenInvoice. There is no link to the Open Invoice file at that point in the import, so the comparison has nothing to evaluate against — attempts with different files and expression shapes do not get it to compare.
- Selection criteria on InvoiceType itself. InvoiceType is the right flag, but it does not appear in the list of fields available to the job, so it cannot be selected on directly. It has to be carried into a field that is available — which is what the InvoiceComment technique does.
- Testing the flag on the InvoiceNo field. The condition on a field is evaluated before the invoice number assignment completes and sets InvoiceType, so logic placed there always reads the flag too early.
Affected versions
Documented on Sage 100 v2018. The technique relies on standard Visual Integrator calculated fields, the Manual Check Entry business object, and AP_OpenInvoice, which exist across Sage 100 versions, but v2018 is the version it is evidenced on.
Prevention / best practice
- Always design exception handling into payment imports: an import that silently creates new invoices for typos in the source file turns a data-entry error into a duplicate-payment risk.
- Keep the marker text ("Invoice Not On File") consistent between the calculation and the selection criteria — the filter is a literal string match.
- Test the job against a file containing one known-good invoice and one deliberately bogus invoice number before it touches live payments, and confirm the bogus line appears in the import log.
Related help
- Visual Integrator Import Issue
- Visual Integrator — Sales Order Import
- VI AR Cash Receipt Import Sample
- Run a Visual Integrator Job in a Cycle
- Include a Carriage Return in a Visual Integrator Job
Still stuck? Send us a screenshot of the error, we will diagnose it for free.
Digit Masters has supported Sage 100 and Sage 300 since 1997. Send the screenshot through our contact page or to contact@digitmasters.com, or call (800) 965-4262.