APEX

Get calling Page

published on

Some of you may know the problem that in certain situation you don't want to just close the current modal dialog, but in certain cases you want to jump to a completely different page. Let's imagine for a moment: The user has navigated from an overview page of e.g. contact persons to a very specific contact person. From there he can call the edit dialog. This dialog can also be called directly from the overview page. If he now wants to delete a contact person, the respective report can simply be updated on the overview page. But if he was on the detail page before, it makes no sense to just close this dialog. In such a case, the user should navigate back to the overview page.

For this we simply create a hidden item on the dialog page and fill it via a DynamicAction "SetValue", which is called on PageLoad, using JavaScript expression

apex.util.getTopApex().jQuery("#pFlowStepId").val()
Dynamik Action - setValue
Dynamik Action - setValue

After that, we only need to distinguish in the submit processes whether we just want to close the dialog or navigate to a specific page.

After Processing - Branch to
After Processing - Branch to

Done.

Happy, apexing