Issue with retrieving values in a post event PX
I have some test code that creates a part:
IAgileClass agileClass = admin.getAgileClass(“FinishedGood”);
Map params = new HashMap();
params.put(ItemConstants.ATT_TITLE_BLOCK_NUMBER, “PART_000022”);
params.put(ItemConstants.ATT_TITLE_BLOCK_PART_TYPE, agileClass.toString());
params.put(ItemConstants.ATT_TITLE_BLOCK_DESCRIPTION, “TESTING”);
params.put(ItemConstants.ATT_PAGE_TWO_LIST01, “10”);
IItem item = (IItem)session.createObject(agileClass, params);
Then I have a post event (event=Create Object) PX that retrieves the values from the newly created part and does some processing:
IItem item =(IItem)PXsession.getObject(IItem.OBJECT_TYPE,”PART_000022″);
System.out.println(“list01 =”+item.getValue(ItemConstants.ATT_PAGE_TWO_LIST01).toString());
System.out.println(“desc =”+item.getValue(ItemConstants.ATT_TITLE_BLOCK_DESCRIPTION).toString());
For some reason, the values are not being retrieved in the second piece of code. But if I create a part using the <Create New> button in the web application, the values will appear in the post event PX.
Does anyone know what I am doing wrong. I suspect the createObject API may be the issue. but I am not sure how to fix it.
Thank you.