Hi
I am trying to insert a new item by selecting the header record
it is ending up with a Illegal state exception Caused by: java.sql.SQLException: Duplicate key: XXXXXX
experts could you please check this thanks !!!!
below is the code i am using to insert the item
ZkumarHeader header = (ZkumarHeader)wdContext.nodezkumar_srv().nodeget_header_asset().nodeget_header_assetOutput().getCurrentElement().model();
ZkumarItem item;
if (header.getItems().size() > 0)
{
item = (ZkumarItem)header.getItems().toArray()[0];
}
else
{
item = header.createNewItems();
}
header.addToItems(item);
wdContext.nodezkumar_srv().nodeget_item_asset().nodeget_item_assetOutput().bind(Collections.singleton(item));
wdContext.nodezkumar_srv().nodeget_item_asset().nodeget_item_assetOutput().setLeadSelection(0);
OcaRoot.getInstance().commit();