Forums

Forums / Developing Portals / Add a "Back" button to CRM Form

Add a "Back" button to CRM Form

Thread is closed for posting
4 posts, 1 answered
  1. j.mondy
    j.mondy avatar
    12 posts
    Registered:
    09 Oct 2015
    09 Nov 2015
    Link to this post
    Hi,

    Trying to add a "Back" button that would cancel any edits on a CRM form, and redirect back to the the previous screen.

    Essentially, I need an "undo" function - a "Submit" button without the submit logic. Any help?
  2. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    12 Nov 2015 in reply to j.mondy
    Link to this post
    Hello,

    Currently there is no easy way to make this happen. To temporarily solve the problem we can remove the submission JavaScript from the submit button and replace it with a custom redirect function, preserving the ID of the record.

    We are looking into ways that we can enable this feature (Undo, Discard Changes) into our existing Multi-X Step Button widgets.

    If you have any additional questions please don't hesitate to ask.

    Best Regards,
    Clinton
  3. j.mondy
    j.mondy avatar
    12 posts
    Registered:
    09 Oct 2015
    12 Nov 2015 in reply to Clinton Bale
    Link to this post
    Given the current functionality, that's about what I had in mind. How would one go about ​overriding the submission logic of the Submit button?
  4. Missing user
    Missing user avatar
    Answered
    13 Nov 2015 in reply to j.mondy
    Link to this post
    Hi ​Josh,

    You can accomplish overriding the submission logic with this JavaScript here:

    $("#​button")[0].onclick = null;
    $("#button").click(function() { alert("done") });

    You will also have to go into the button's advanced properties and set "UseSubmitBehavior" to false.

    Advanced Properties Submit Button

    Additionally, if you are using the Multi-​Form/​Page step buttons there is another way to do this. You may override the OnClientClick event located in the advanced properties of the Multi-Form/Page step buttons by inserting JavaScript code or a function.

    Advanced Properties Multi-Form Step Buttons

    However, please note that if you are directing to a previous page, you must ensure that the "step" query string parameter is set to the GUID of the appropriate form - this is how the Multi-Step buttons keep track of where they are.

    You can do this with the code:

    window.location.origin+window.location.pathname+ "?step="

    Where the value of the querystring parameter of step is the GUID of the appropriate form.

    Hopefully this helps!

    Kind Regards,
    Chris.
    Last modified on 13 Nov 2015 14:11 by Missing user
4 posts, 1 answered