Menu

#2676 Doc Value Workflow can't Set Variable for ID column

open-fixed
KittiU
5
2011-09-15
2011-09-15
KittiU
No

If the set variable is in the column that Reference Type is Numeric, the MWFActivity.setVariable(...) is working OK.
But if the column is ID column, i.e., Table, Table direct, it will fail. This is because there is no checking for ID, and it parse as object instead of integer.

Step to Error

1. Setup a Document Value Workflow, make it to set value into any column with type Table or Table Direct.
- Document Value for C_Invoice with condition Updated=Created, set column C_DocTypeTarget_ID to value 118 (Credit Memo)
2. New Invoice Document, save it. Nothing updated in the Target DocType.

Discussion

  • KittiU

    KittiU - 2011-09-15
    • assigned_to: vpj-cd --> kittiu
    • status: open --> open-fixed
     
  • KittiU

    KittiU - 2011-09-15

    diff -r 71ebef5898d9 base/src/org/compiere/wf/MWFActivity.java
    --- a/base/src/org/compiere/wf/MWFActivity.java Thu Sep 01 14:12:17 2011 -0500
    +++ b/base/src/org/compiere/wf/MWFActivity.java Thu Sep 15 13:00:05 2011 +0700
    @@ -1150,6 +1150,8 @@
    dbValue = new Boolean("Y".equals(value));
    else if (DisplayType.isNumeric(displayType))
    dbValue = new BigDecimal (value);
    + else if (DisplayType.isID(displayType)) // kittiu
    + dbValue = new Integer (value);
    else
    dbValue = value;
    m_po.set_ValueOfColumn(getNode().getAD_Column_ID(), dbValue);

     

Log in to post a comment.