Document Validation Customization Example
NOTE: There is an updated implementation of Document Validation here. This new version is much nicer and more capable what is demonstrated below. The purpose of this post is to present the process and artifacts of creating Document Validation. Document validation helps make sure the data entry is accurate. More specifically, it prevents users from making known mistakes. It also holds users accountable for important decisions. There are two approaches presented in this page. The first approach is presented in the first video. It is more simple in nature, and it does not require you to write any java code. The second is a more enterprise ready approach that gives more programming freedom and flexibility as well as increase the detail in your audit path.2014-09-30 AM - Open Discussion Including Simple Document Validation
- Introduction to Document Validation
- 0:02:00 Illustrate the situation we are trying to prevent - creating an order line with no product AND no charge. It should have one or the other.
- 0:03:15 Discuss possible solutions - creating a view to trap that bad situation.
- 0:04:15 Create the first SQL statement
- 0:09:30 Update the user interface to show the hard fail (bad situation)
- 0:11:45 How to prevent users from printing until the document is in a known good state.
- 0:15:00 Create a C_Order column SQL (colsql) to let the order know when there is a hard fail (bad situation).
- 0:18:45 Add Hard Fail column to the Sales Order window (Window, Tab & Field)
- 0:20:00 Prevent the user from completing the order if a hard fail exists.
- 0:21:45 Be careful about adding column sql to a high volume or high record count table. It can slow down your system.
- 0:23:45 Create a view that unions (union all) all the hard fails into a single view so that we can easily check and display results to all users.
- 0:29:30 Add an additional check - create new view and add to union-ed list
- 0:38:30 Modify the views to include the line number in the problem's description
- 0:44:00 how to add Advanced Search windows to be able to search by line details. Add the line details to the Business Partner Info window.
- 0:48:15 Demonstration of how to install Advanced Search
- 0:51:30 How to create a zoom-able field (hyperlink) to itself - for when someone exposes a table instead of a view in a separate window - like Business Partner Info window.
- 0:52:30 Ora-00020 - maximum number of connections exceeded in Oracle
- 0:58:30 How to create programs/processes that use the least number of connections (managing transactions)
- 1:04:00 How to delete child rows when the parent row is deleted - use cascade delete as the type of foreign key reference in database.
2014-03-20 AM Meeting - Document Validation Design #1
2014-03-25 AM Meeting - Document Validation Design #2 Design Presentations
2014-03-26 Description of Steps
- Posted a discussion on the iDempiere forum about the best way to achieve my goal. The below steps represent their advice.
- Followed these steps to create the iDempiere plugin (create plugin and start plugin)
- Created an iDempiere process called ValidateDocument. For now, it does nothing but look pretty.
- Added my new fields to C_Order Table and Column window and Order Window, Tab and Field window.
- DateValidated
- Do_ValidateDoc - pointed to above process by creating a new record in the Report & Process window.
- isValidateApproved
- isValidateHardFail
- isValidateOverride
- Validate_DocAction
- ValidateHash
- ValidationNotes
- Used the iDempiere model.generator (run configurations) to create my interface that contains the above fields
- model.validator
- Path = src folder of my plugin project
- Package = com.chuboe.model
- Table = C_Order
- Entity Type = D
- Only generated the interface
- Renamed the newly created interface to I_C_Order_DocVal and set to extend I_C_Order
- Removed all but the eight newly created columns from I_C_Order_DocVal
- model.validator
- Updated my process to use the newly created I_C_Order_DocVal interface with a POWrapper as illustrated here. Tested with success.
2014-03-27 AM Meeting - Document Validation Design #3 Design Review - POWrapper
2014-04-01 AM Meeting - Document Validation Design Review Session 4
2014-04-08 AM - Document Validation Design Review Session 5
- Includes discussion of Mercurial fork/pull/branching/releases