Event PX to update lifecycle phase in affected items
Hi
Have a requirement to update lifecycle phase of a affected item based on a particular condition. When tried using update table event, without using event dirty methods, it updates but multiple events are triggered as seen in history and event handler monitor.
How to use dirty methods to update the lifecycle phase of an affected item of a change order?
Sabarish
Hello
Please check SDK Developer Guide – Developing PLM Extensions
Example 5–10 Using IEventDirtyTable – it gives a good example of how to use UpdateTable and set dirty cells in BOM tab
You can follow similar approach for Affected items tab as well
– Raj
We were able to resolve this.
We used the dirty cells in the following approach .This works with pre trigger.
IEventDirtyRowUpdate row1 = (IEventDirtyRowUpdate)it1.next();
IItem daffItem = (IItem) row1.getReferent();
ICell LCcell = daffItem.getCell(ItemConstants.ATT_TITLE_BLOCK_LIFECYCLE_PHASE);
IAgileList NewLCvals = (IAgileList)LCcell.getAvailableValues();
//set the Affected Item New LC Phase value to xxx if the Item Type is xxx
//IAgileClass cls = LCcell.getAttribute().getListAgileClass();
ArrayList al = new ArrayList();
al.add(“xxx”);
Object[] ItemLCP = al.toArray();
NewLCvals.setSelection(ItemLCP);
row1.setCell(ChangeConstants.ATT_AFFECTED_ITEMS_LIFECYCLE_PHASE, NewLCvals);