Skip to Content
0
Former Member
Jan 11, 2008 at 09:17 AM

Dynamic SBO_SP_TransactionNotification with 'Rules' UDT

33 Views

Dear Forum experts,

I'm looking to modifying SBO_SP_TransactionNotification with some very generic code looking at a 'rules' userdefined table rather than coding each validation into the SP itself.

The idea here is that end users / non-programmers are able to specify custom validation and approval rules via the front-end and capturing these rules into a UDT. A new UDT with the following fields could be used as basis:

- Table (source table for checking)

- Field (source field for checking)

- Operator (=,!=,<,>,isnull,in, not in, etc)

- Value (value that the operator tests against)

- Error Code

- Error Message

- ObjectType

- TransactionType

- etc

If for example, VAT Codes must be filled in for Business Partners, then the UDT would look as follows:

- Table OCRD

- Field ecvatgroup

- Operator =

- Value null

- Error Code 200

- Error Message 'VAT Code is missing'

- ObjectType 2

- TransactionType A

The creation of the UDT and capturing data into it then becomes quite simple and the SP code in essence is also kept to a minimum at complex sites.

I assume each field would be declared as a variable inside the SP and the SP loops through the UDT (cursor?) and performs the necessary and any additional checks. Is this possible?

Does anyone have an idea how to create this code for SBO_SP_TransactionNotification?

Many thanks

Andre