Forum Discussion

MichaelTamoush's avatar
MichaelTamoush
Qrew Captain
3 years ago

SaveBefore Navigating

It seems if you use this on a GenAddRecord API, it performs the save but will not perform any subsequent calls (just refreshes and lands you on the page)? Has anyone else experienced this?

------------------------------
Mike Tamoush
------------------------------

2 Replies

  • BradLemke's avatar
    BradLemke
    Qrew Assistant Captain

    What's the full formula/use-case?  I have a 'savebeforenavigating' nested in several formulas that also use the data-replaceRid=true with the new RID being slotted into an &rdr=" URLEncode(...%%rid%%...).  So far, for almost all of my use-cases, the class has worked out fantastically.

    I just wish there was a way to make it function *more* like the native 'Save&close' and/or 'Cancel' buttons, where I don't have to specify where to go after the button is clicked.



    ------------------------------
    Brad Lemke
    ------------------------------
    • MichaelTamoush's avatar
      MichaelTamoush
      Qrew Captain
      I abandoned the effort, but the formula was about as follows:

      var text EditRecord = Edit Record API Call
      var text AddRecord = AddRecord API Call
      var text Redirect = URL for redirect

      "<a class='SaveBeforeNavigating' href="
      & $EditRecord
      & "&rdr=" & URLEncode($AddRecord)
      & URLEncode("&NextURL=" & URLEncode($Redirect))
      & "<span style='color:#7e308c'><b>Words for Button</b></span></a>"

      The interesting thing was - it worked PERFECT if the record existed and I was simply in edit mode. However, if the record did not exist and was in Gen Add Record mode, it simply saved the record and landed back on it without doing anything. I troubleshot by removing everything and just having a very simple redirect as my only action, and it would not perform the redirect.

      Since you have used the %%rid%%, if you get a chance check out my other DIscussion post a few before this one about that very topic. I am having difficulty with consistency on that new functionality also.

      ------------------------------
      Mike Tamoush
      ------------------------------