extools¶
extools - Python tools for Orchid Extender
This package provides a number of utility functions designed to make working with Extender for Sage 300 easier.
A View-like object is any object which responds to .put, .get, .recordClear, .browse, .fetch, .update, .insert.
-
extools.
lines_in
(ds)[source]¶ Generator that yields all records in a datasource.
Parameters: ds – an instance of an accpac.UIDataSource
-
extools.
lines_in_view
(viewid)[source]¶ Generator that yields all records in a view.
Parameters: viewid – The identifier of the datastore (i.e. dsOEORDH)
-
extools.
open_and_fetch_row
(viewid)[source]¶ Open the view and fetch the first row.
Parameters: view – RotoID of the view to open and fetch from Return type: accpack.View or None
-
extools.
success
(*args)[source]¶ Check if the return values from view actions indicate success.
Extender view calls return 0 on success and non-zero on failure. Use this function to check whether a collection of view calls have been successful.
Parameters: *args – any number of return values. Return type: bool view = openView("EX0001") rc = view.recordClear() br = view.browse("") fe = view.fetch() if not success(rc, br, fe): showMessage("Failed to open EX0001 and seek to the first record.")