Forum Discussion

JeffKelly1's avatar
JeffKelly1
Qrew Member
4 years ago

Redirecting to previous page after creating appointment

I thought this had been covered before in the forums, but I couldn't find the answer. I am trying to create a new record from a report page with the default new record button. Then when I save the appointment I'd like it to redirect to the previous page. I've tried various versions of what's below using the IOL technique but can't seem to change the behavior to redirect after save. The idea is to get the current URL of the report page, then store it as a URL parameter that can be accessed on the next page. It just displays the new record instead of redirecting.

Thanks in advance for any help!

$( document ).ready(function() {
    var newApptButton = $("#stdAddRecButton");
    var saveButton = $("#saveButton");

    var searchParams = new URLSearchParams(window.location.search);
    var rdrURL= searchParams.get('RedirectURL');
    console.log(rdrURL);
    newApptButton && console.log(newApptButton.attr("href", newApptButton.attr("href") +"&RedirectURL="+window.location.href+"'"));
    saveButton && console.log(saveButton.attr("href",saveButton.attr("href")+"&rdr="+rdrURL));

});


------------------------------
Jeff
------------------------------
No RepliesBe the first to reply