How to cancel a case without it being created

I have a requirement not to create a case when the Cancel button is hit and also when closing from the ‘X’ icon.

I have a Menu with the label “New type_case” and the Action Create Work, which creates the new case for me.

When I click on “New type_case”, it creates the new case in the “MTO-170” Tab, to cancel it without leaving it as created, what I am doing now is to delete it by clicking on the “Yes, Cancel” button, in an activity via its pzInskey.

Activity on “Sí, Cancelar” button:

So far there is no problem, what I do is delete the created case, since what I want is to cancel its creation.

The problem is, how do I do the same thing but when closing the Tab from the “X” icon?

This icon comes out of the box and I don’t have access to it as in the case of the custom “Yes, Cancel” button.

Where can I put that same activity so that it runs when I close it via the “x” icon?

Thank you very much for your time and help.

@MARCO_GL

I would recommend using temporary cases instead of trying to delete the case for every scenaior if a user backs out.

It used to be a common configuration on the case type and was available in Case Designer to enable temporary cases, that do not get saved to the database until the “Persist Case” automation step was reached in the flow. (so if a user just opens a case and then closes it without submitting any input, the case does not get saved)

Pega has not documented why this has been deprecated, but it’s most likely due to the new stateless architecture for React front end.

You can still enable this in the following way (since you are using UI Kit this would be the best way to handle it).

  1. Find your case type in the Case Types explorer, Right Click → Open → Advanced Tab → at the bottom enable “Create temporary case that is not saved until a ‘Persist case’ step is reached” and save.

  2. Now when you create a case, the case is not persisted to the database immediately and a pyID is not yet generated.

  3. In your process, after the assignment for which you want users to enter the required data to create case, add the automation “Persist Case”, this will crete the pyID and save the case to the database.

Please see the help files and the Pega Academy course for this feature:

@MARCO_GL , please go case setting and try the 2 options showed in the attached screen shot. this should work .

@MARCO_GL in 8.6 you cannot do temporary casa from settings of case life cycle .

open pydefault casetype rule . In the advanced tab select temporary check box

Apparently my version of Paste does not have this option, I am in version 8.6. But now I understand that you mean the same thing as joseh9464.

Thank you very much.

This has worked for me. Thank you very much!