Thanks everyone for your advice. I achieved success. Here were my steps for future reference:
- 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 ValidationNotes field to C_Order Table and Column window and Order Window, Tab and Field window.
- Used the iDempiere model.generator (run configurations) to create my interface with my new field(s). NOTE: I actually created eight new fields on C_Order. That is why I used the model.generator instead of just creating the Interface by hand.
- model.validator
- Path = src folder of my plugin project
- Package = com.chuboe.docval.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 newly created columns from I_C_Order_DocVal
- Updated my process to use the newly created I_C_Order_DocVal interface with a POWrapper as illustrated here. Tested with success.
Here was my interface (only showing the one field):
public interface I_C_Order_DocVal extends org.compiere.model.I_C_Order
{
/** Column name ValidationNotes */
public static final String COLUMNNAME_ValidationNotes = "ValidationNotes";
/** Set Validation Notes.
* Feedback from the last validation. If a given line states "Hard Fail", then the document action cannot proceed unless Validation Override is checked.
*/
public void setValidationNotes (String ValidationNotes);
/** Get Validation Notes.
* Feedback from the last validation. If a given line states "Hard Fail", then the document action cannot proceed unless Validation Override is checked.
*/
public String getValidationNotes();
}
Here was my process doIt method. Note that is makes use of both the MOrder and I_C_Order_DocVal classes in conjunction (see the save method).
protected String doIt() throws Exception {
MOrder order = new MOrder(getCtx(), getRecord_ID(), get_TrxName());
I_C_Order_DocVal order_dv = POWrapper.create(order, I_C_Order_DocVal.class);
if (order_dv != null)
{
order_dv.setValidationNotes("Simply Wonderful"); //new field
order_dv.setDescription("Simply Wonderful"); //existing field set through POWrapper
order.saveEx(); //called on MOrder object to save (not POWrapper)
}
return "OK";
}
Regards,
Chuck Boecking