Sage 100 Business Object Interface (BOI) explained
What the Sage 100 Business Object Interface is, how sessions and business objects work, and the mistakes that cost developers the most time.
The Business Object Interface, usually shortened to BOI, is how external code talks to Sage 100's own business logic. It exposes the same objects the Sage screens use, through COM, so a script can create a customer or a sales order and get the same validation a user would.
It is also the part of Sage 100 development with the steepest learning curve. This guide covers the concepts you need before you write the first line.
How BOI is put together
Sage 100 is written in ProvideX. BOI is the ProvideX runtime exposed as a COM server called ProvideX.Script. From any COM client (VBScript, VBA in Excel, C#, PowerShell) you:
- Create the
ProvideX.Scriptobject and point it at the SageMAS90\Homefolder. - Create a session object,
SY_Session. - Log the session in: user, company, module, module date, and the program (task) you are acting as.
- Create a business object such as
AR_Customer_busorSO_SalesOrder_busbound to that session. - Set keys, set values, write, and check for errors.
Objects you will use most
| Business object | What it handles | Typical task for nSetProgram |
|---|---|---|
AR_Customer_bus | Customer maintenance | AR_Customer_ui |
SO_SalesOrder_bus | Sales order entry, header and lines | SO_SalesOrder_ui |
AR_Invoice_bus | AR invoice data entry | AR_Invoice_ui |
CI_ItemCode_bus | Item maintenance | CI_ItemCode_ui |
AR_Customer_svc | Read-only lookups (service objects) | none needed for reads |
Objects ending in _bus change data. Objects ending in _svc are read-only services, cheaper when you only need to look something up.
A complete example: create a customer
Set oScript = CreateObject("ProvideX.Script")
oScript.Init("C:\Sage\Sage 100\MAS90\Home")
Set oSS = oScript.NewObject("SY_Session")
If oSS.nSetUser("integration", "secret") = 0 Then WScript.Quit 1
oSS.nSetCompany "ABC"
oSS.nSetDate "A/R", "20261204"
oSS.nSetModule "A/R"
oSS.nSetProgram oSS.nLookupTask("AR_Customer_ui")
Set oCust = oScript.NewObject("AR_Customer_bus", oSS)
oCust.nSetKeyValue "ARDivisionNo$", "01"
oCust.nSetKeyValue "CustomerNo$", "NEWCO"
oCust.nSetKey
oCust.nSetValue "CustomerName$", "New Customer LLC"
oCust.nSetValue "TermsCode$", "01"
If oCust.nWrite() = 0 Then
WScript.Echo "Write failed: " & oCust.sLastErrorMsg
End If
oCust.DropObject
oSS.nCleanup
oSS.DropObjectConventions that trip people up
- Field names carry a type suffix. String fields end in
$(CustomerName$), numeric fields do not (CreditLimit). Asking forCustomerNamewithout the$fails quietly. - Methods return 1 or 0. Most
nmethods return 1 for success and 0 for failure. ReadsLastErrorMsgon the object, not the session, after a failure. - Dates are strings in
YYYYMMDDform. - The module date matters. Sales orders and invoices are posted against the module date you set with
nSetDate. A wrong date puts transactions in the wrong period. - Clean up. Call
DropObjecton business objects andnCleanupon the session. Long-running services that skip this leak memory and hold locks.
Licensing and sessions
Each BOI session logs in as a Sage user. Plan a dedicated integration user and check how your Sage licence counts concurrent users, because a busy integration can block a real person from logging in.
Where BOI stops being the right tool
BOI is excellent for writes on the Sage server. It is a poor fit for reads at scale (use ODBC or a read API) and for cloud apps that cannot run code on the customer's machine. If you support many customers, see BOI vs ODBC vs REST.
A REST API for Sage 100, self-serve
One HTTPS endpoint and a typed SDK instead of BOI scripts and ODBC DSNs on every customer's server. Read access is free during the beta.
Join the waitlist