SBO_SP_TransactionNotification: Blocking Bad Data Before It Reaches the Database
The stored procedure every SAP B1 admin should master. Learn the parameters, safe coding patterns, and five production-ready validation rules you can deploy today.
SAP B1 Academy Editorial
Published • 4 min read
Every SAP Business One database ships with an empty stored procedure called SBO_SP_TransactionNotification. It fires after a document or master record is added, updated, cancelled, or closed, but before the transaction is committed. That makes it the most powerful (and most abused) place to enforce business rules that standard configuration cannot.
How the Procedure Works
When a user clicks Add or Update, SAP B1 calls the procedure with five input parameters and expects two outputs back:
- @object_type: the object ID as text. For example
17is Sales Order,13is A/R Invoice,2is Business Partner, and4is Item Master Data. - @transaction_type:
A(Add),U(Update),D(Delete),C(Cancel), orL(Close). - @list_of_cols_val_tab_del: the key value of the record, usually the
DocEntryorCardCode. - @error / @error_message: set
@errorto any non-zero value and the client rolls back the transaction and shows your message.
Because the procedure runs inside the transaction, a slow query here slows down every document posting company-wide. Keep each rule tightly filtered by object type and transaction type.
The Golden Rules Before You Write Any Code
- Never modify data inside the procedure. Validate only; use the DI API or Service Layer for updates.
- Always filter on
@object_typeand@transaction_typefirst so unrelated postings skip your logic. - Keep a version-controlled copy of the procedure. Upgrades and copy-company operations can overwrite it.
- Prefix every message with a rule code (for example
[SO-01]) so support teams can trace complaints quickly.
Sign in to continue. This deep-dive is available to Pro members.
Join SAP Business One consultants and key users worldwide. Free forever, no credit card required.