Close Modal Dialog without calling any actions similar to Cross icon

Hi Team,

I need a button on modal dialog to close it without executing any futher actions similar to clicking on X icon

Tried the below actions:

OOTB Close action

JS Function: pega.u.d.hideModalWindow

JS Function: pega.u.d.activeGrid.cancelModal(event);

@RichardMarsot Do we have a way to mimic the behavior of Cross on the modal dialog.

@Avinash.Haridasu did you try the OOB ‘cancel’ action (not close)

pega.u.d.hideModalWindow() should work too - make sure that you run the JS in the correct context if using a multi-doc container (iframe)

@Avinash.Haridasu

Configure onClick event on the button and Add RunScript as the action. In the runscript just add “pega.u.d.doClose”.

@RichardMarsot Thanks Richard.

We’re launching the modal dialog from a case in Cosmos Portal and the moment we close the modal dialog using hideModalWindow, it throws an exception “NullStepPage”.

While the close button on top right of modal dialog, does the job correctly. I was actually looking for the API to invoke the same function used in cross button in header, from our close button.

We also tried the Cancel option but even that throws some error in our case.

Using “pega.u.d.handleModalCancel” did the job