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.

Add Comment
3 Answer(s)

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.

Agile Angel Answered on April 21, 2018.

Hello Matt Paulhus.

I appreciate your help.
I think I solved the issue with Karthik’s solution.

Thank you for your suport.

My best.

on April 22, 2018.
Add Comment

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();

Agile Talent Answered on April 22, 2018.

Hello Karthik.

Thanks a lot for your support.

It worked just fine.
I discovery, when I used your example, that if I use this way “info.getValue(2020);” works fine too.

I appreciate your help.
Thanks a lot.

My best.

on April 22, 2018.
Add Comment

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.

Agile Angel Answered on April 23, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.