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.
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).
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.
Now when you create a case, the case is not persisted to the database immediately and a pyID is not yet generated.
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: