Forum Discussion

AndrewFry's avatar
AndrewFry
Qrew Assistant Captain
6 years ago

After using button, return is non-functional

Typically, when I open my parent record form, click "add child record", fill out that child records form, then click save and close, it returns me back to the parent record form to continue filling it out (if needs be).

Due to certain circumstances, in my child record form, when it is a new record (not previously saved), I have a custom "Save & Continue" button. It saves the child record so that is related to the parent record and I can then bring down some item from that parent record through the child record, into a grandchild record.

However, when using that button, it appears to break the return path back up to the Parent record. After using the "Save & Continue", if I then use the built-in "Save & Close", it saves the child record, but just takes me to view the child record. It doesn't take me back to the Parent record in edit mode.

Can the return path back to the parent record be maintained some how so that even if I use the "Save & Continue" custom button, once I use the built-in "Save & Close" button, it returns me back to the Parent form in edit mode?

Here is the simple code for the "Save & Continue" buttons. It is a Rich Text Formula field.

"<div class='Vibrant Success' onclick=$('#footerSaveAndKeepWorkingMenuOption').click();>Save and Keep Working</div>"

------------------------------
Andrew
andrew.fry25@gmail.com
------------------------------
  • You may need a custom save button for that and hide that default save & close. 

    Formula URL (go to parent and edit)
    URLRoot() & "db/" & [_DBID_CLIENT] & "?a=er" & "&rid=" & [Related Project]​

    Formula Rich text (save and redirect button)
    var text myurl = [Go To Parent];
    
    "<a class='Vibrant Success' onclick='DoSave();' href='" & $myurl &"'>Save</a>"​


    ------------------------------
    Everett Patterson
    ------------------------------
    • AndrewFry's avatar
      AndrewFry
      Qrew Assistant Captain
      Everett,

      Thanks for the info. Sorry about a delayed response.

      If I understand you correctly, I will need to update my custom button.

      The two pieces of code you have provided, if I understand them correctly, I can use one or the other, but do not need both, right? It depends on which option I want?

      Also, in the first code, the [_DBID_CLIENT] and the [RELATED PROJECT] needed to be switched out with the actual names of the tables, correct?


      ------------------------------
      Andrew
      andrew.fry25@gmail.com
      ------------------------------
      • EverettPatterso's avatar
        EverettPatterso
        Qrew Captain
        The two pieces of code you have provided, if I understand them correctly, I can use one or the other, but do not need both, right? It depends on which option I want?​

        You need both, the save button will point to the formula URL

        Also, in the first code, the [_DBID_CLIENT] and the [RELATED PROJECT] needed to be switched out with the actual names of the tables, correct?

        Yes, use your table names

        $("#saveButton, #saveButton + a").hide();

        As Jordan mentioned, it uses the IOL technique, injects script as the page loads 



        ------------------------------
        Everett Patterson
        ------------------------------
    • AndrewFry's avatar
      AndrewFry
      Qrew Assistant Captain
      Everett,

      How do I hid the default save & close button?

      Thanks a ton! :)

      ------------------------------
      Andrew
      andrew.fry25@gmail.com
      ------------------------------