Refresh Parent Page After Closing a modal Popup

I have a few action buttons on my page. After performing one of those actions by opening a modal page and clicking another action button (not using the save button), I always needed to manually press the refresh button to display the correct record count from a rollup field. The “Action Button Page Refresh” plug-in didn’t work for my setup, but this script did exactly what I needed.

When the modal form closes, it ‘auto-clicks’ the refresh button on the parent page:

$(document).on(‘click’, ‘.modal .btn.btn-danger, .modal .close’, function () {
setTimeout(function () {
$(‘.t-refresh-button’).trigger(‘click’);
}, 150);
});

If your modal page updates data and you want the parent table to refresh automatically after closing the called page, this worked reliably for me.