poplar_isocc - Enforce ISO-3166-1 Country Code in Sage 300

This package enforces the use of ISO-3166-1 compliant country codes in any field in the Sage Desktop. It contains validation code as well as unit and acceptance tests.

poplar_isocc part of a general demonstration of how Python Packaging can be used with Orchid Extender. Best consumed with the accompanying presentation, Python Packaging for Extender - ISO Country Codes and a cold beer.

The code in this package is very simple, relying on the iso3166 package for reference data and performing only a simple validation. It demonstrates the key concepts in improving code reuse and distribution for Extender, including:

  • leveraging the extools library for testing
  • inclusion of unit and acceptance testing using ExTestCase
  • how packaging can make installation, upgrade, and backport a breeze

This package can be used to demonstrate the upgrade and feature backport. The relevant versions are:

  • v0.1.3: enforces two character ISO country codes on A/R Customer Country
  • v0.2.0: enforces three character ISO country codes on A/R Customer Country
  • v0.3.7: enforces three character ISO country codes on A/R Customer Country with fuzzy matching and recommendatons on invalid code.

To demo with this package:

  1. Install expip, the Package Manager for Orchid Extender.

  2. Open A/R Customers, input the value “CDN” into a new Customer Record.

    • The put is successful.
  3. Open expip and install poplar_isocc==0.1.3. This version enforces two character country codes.

  4. Open A/R Customers, input the value “CDN” into a new Customer Record.

    • The put fails with a message to the user.
  5. Input the value “CA” into the new Customer Record.

    • The put succeeds silently.
  6. Open expip and install poplar_isocc==0.2.0. This version enforces three character country codes.

  7. Open A/R Customers, input the value “CA” into a new Customer Record.

    • The put fails with a message to the user.
  8. Input the value “CAN” into the new Customer Record.

    • The put succeeds silently.
  9. Open expip, select poplar_isocc from the drop-down, and click Upgrade. This will install the latest version, which includes fuzzy matching to make recommendations on invalid input.

  10. Open A/R Customers, input the value “CDN” into a new Customer Record.

    • The put fails with a message to the user recommending “CAN”
  11. Input the value “CAN” into the new Customer Record.

    • The put succeeds silently.

Done.

This package, the Python Package Manager for Orchid Extender, and the extools library were created and are maintained by 2665093 Ontario Inc. Comments and quesions are always welcome, send an email.