Stop Saving(As) / Creating new parts based on some criteria

Hi,

Can you help me how can I stop the saving or creating new part process based on some criteria?

For example: if the part number has something in the description or the part number contains  some given letters

In this cases, I would like to stop the process. To not to save the changes or not to create the new part number.  To give me some error or just stop.

I tried it with exceptions from PX + eventhandlers but it did nothing just put the error to the history tab.

(I’d love to create some pop up window as well after the criteria is true but it’s not working as I red – but I can send emails from Java PX)

 

Thanks,

Feri

Agile User Asked on February 19, 2020 in Software Development Kit (API).
Add Comment
3 Answer(s)
Best answer

Feri – Did you try using the Events – Create and SaveAs and extend the behavior on how you want to do the creation / save as based on pre-defined critierias.

Thanks,

Sankar.

Agile Angel Answered on February 27, 2020.

Thanks! Checking that..

on March 5, 2020.
Add Comment

You can also do this without a PX. SaveAs is a privilege. As you know, privileges have criteria. You can give your user a SaveAs privilege with criteria of when they can do SaveAs.

Agile Angel Answered on February 28, 2020.

Thanks! I’m checking that. What I noticed that when try to do it at ‘create’ privilege, my new criteria does not come up. I can’t choose it.

As I see it won’t work, because If I create a criteria for a part number, ex: there can’t be a  letter ‘B’ in it, then it refers to the original part number not the newly created. So if there is an existing part number xxxxxxB-01 then the SaveAs function is disabled.
I want to do this for the new part number that I wan’t to create with the SaveAs. So to check the new part number.

on March 5, 2020.
Add Comment

How is your event subscriber set up? I believe it would need to be set up as a “Pre” Trigger Type event and Error Handling Rule should be set to stop.  Any exception that occurs from the PX will stop the Save-As from happening.  Throw the string you want to present the user as an AgileDSLException

Example: throw new AgileDSLException(“You Cannot perform a SAve-As….”)

Agile Talent Answered on February 27, 2020.

Is this only works with AgileDSLException?

on March 5, 2020.
Add Comment

Your Answer

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