Redirecting to previous page after creating appointment

  • 1.  Redirecting to previous page after creating appointment

    Posted 8 days ago
    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');
        newApptButton && console.log(newApptButton.attr("href", newApptButton.attr("href") +"&RedirectURL="+window.location.href+"'"));
        saveButton && console.log(saveButton.attr("href",saveButton.attr("href")+"&rdr="+rdrURL));