Get values from Create New / Items / Parts pop up
Hello everyone.
I have a issue and I need some help.
To create a new Item/Part, a popup is opened and I fill the mandatory fields.
I need to create a Script PX to get this values informed in the fields of the popup, in a Pre Trigger Type, to validate the informations, before saving.
My problem is how to get this values in a Pre Trigger Event.
Some idea?
I’d like to thank in advance.
Best regards.
You won’t be able to at this point. When a user Creates a new Change Order (or Save As), the values in that pop up window are transient data – the new Change Order is not created yet and the information has not been sent to the database until the user clicks ‘Create’. Therefore, no Pre-event script will get any data because there’s no ECO created yet.
You’ll have to work around this. What I’ve done is create Post/Synchronous Script PX that defaults certain values on the Change Order based off of the user input. You can also set up those same validation checks to trigger when someone submits their Change Order instead.
Hope that helps.
Hi Reo,
We can validate the information before object is created
void invokeScript(IBaseScriptObj obj)
{
ICreateEventInfo info=obj.getPXEventInfo();
IEventDirtyCell date=(IEventDirtyCell )info.getCell(2002);
//Validate the value from cell
If(invalid case)
{
throw new AgileDSLException(“Enter Valid Data”);
}
Get the object Number by below code
String number=info.getNewNumber();
Oh right! Dirty values. Of course.
I should have remembered dirty values as that’s how to work with the transient data I was mentioning.