Transaction Notification in SAP B1

Transaction Notification in SAP B1:-

In this post, i will explain Transaction Notification in SAP B1.SP_Transaction Notification is the stored procedure automatically created in each database when we create the database.We use this procedure for handling the validation against the business object so that we can prevent the users from doing some action when the condition is being false.It receives the notification of data -driven event against the specific business object when we work on the business object like -Invoice, Sales Order, Purchase Order etc.

There are two types of Transaction notification procedure namely:
1-[dbo].[SBO_SP_PostTransactionNotice]
2-[dbo].[SBO_SP_TransactionNotification]

[AdSense-A]

1-[dbo].[SBO_SP_PostTransactionNotice] :
In this procedure, we can add our code for doing some action after completion of the transaction.Generally, we don’t need this procedure because most of the validation we have to put before completion of the transaction thus we prefer the second one.

2- [dbo].[SBO_SP_TransactionNotification]:
In this procedure, we can add our code for doing some action before completion of the transaction.Mostly we use this procedure for making the validation against business object transaction.It is also known as PreTransactionNotification .

This procedure must return two values for instance:-
1-@error
2-@error_message

Transaction will be rollback if @error holds value other than Zero with the @error message
There are five parameters in the TransactionNotification That procedure takes as an input for the specific business object. These are as:

@objecttype – The object type Of the business Object.this is a string value and represents the object Ex- Business Partner-‘2′, GRPO -’20’.
@transaction_type – This is the action type eg [A]dd, [U]pdate, [D]elete, [C]ancel, C [L]ose
@num_of_cols_in_key – number of columns/fields in the key of the record.
@list_of_key_cols_tab_del – This parameter keys name on which Document going to identify
@list_of_cols_val_tab_del – It automatically receives the current key for identifying the object’s document ex-When we Opens Sales Order, Example: Current DocEntry will be received in this parameter.
How to Use this PrExample:

Prevent a user from adding a GRPO if the field ‘Customer Ref. No’ is empty/blank.

[AdSense-A]