Forum Discussion

EmberKrumwied's avatar
EmberKrumwied
Qrew Captain
4 days ago

Save and Continue Issue

Issue with native Save and Keep Working button.

I have a form, on which are several fields that a user completes, the results of which feed into several GetFieldValues fields. These retrieves prices from another table based on the selections made. That part works fine, but then there are some additional calculations made using that price and other fields on the form, but the price isn't "retrieved" until the record is saved. Thus, the need for the Save and Keep Working option. But that button doesn't behave in an expected way.

So I'm struggling to determine the cause within my environment when using the native Save and Keep Working button. First: after the first time this button is selected, the Save and New option no longer appears. And Second: sometimes when using this option, and just Save, the form saves but a new empty form is presented.

Is there a better/different way I could save and continue mid-form data entry, so that my price retrievals occur, but allow the user to still have the option to save and add a new record?

13 Replies

  • I tried that option, but it opens the child record in a new browser tab. When you save the child record you are returned to the parent record (in the new tab that opened) but the "original" tab showing the parent record is also opened. If there was a way to force the full screen form to open in the same tab, I'd go that route.

  • Congratulations.  You head must hurt from all that banging against that wall.  There may be a way to do what you want w.r.t. to keeping them in the popup, but I just noticed that there is a setting on the embedded report side panel setup for

    Open record in sub form

    Would it be a more consistent or at least an OK user experience to not open in the sub form (which I believe is the default) and just always keep them in full screen?

     

  • So I decided to clear all my previous attempts and recreated a formula rich text field and placed the following code:

    var text rid = 
        If([CID]>0,
            ToText([CID]), // Record ID already exists
            "%%rid%%" // New record, no Record ID exists yet
        )
    ;
    var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;

    "<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Save & Refresh Pricing</a>"

    I am no longer getting an error. Yay! The form refreshes and my pricing fields are update, however, one of the ways a user would access this form is from an embedded report. When they click on the pencil icon or the eye icon the form opens as a subform popup screen. But after click the new button, the form refreshes as a full window form. Upon saving, it does return to the parent record it originally launched from. Is there any way to configure the button to refresh but stay as the popup form?

    I attempted to add "data-height=200 data-width=200" in the a class statement, but that didn't do anything.

  • Denin's avatar
    Denin
    Qrew Trainee

    Could be wrong, but I have the impression it's something to do with your device or browser. I get that "Something went wrong" error from time to time, but usually I'd see if it I did something like leave the form editor open for a long time (like hours or days) and then come try to save it but the session is already expired.

     

    Another possibility to consider is whether the primary key for the table is actually record ID. Maybe it was changed, so the formula doesn't work.

    • EmberKrumwied's avatar
      EmberKrumwied
      Qrew Captain

      I have never gotten this error before. The form had not been opened that long, but just to be sure I completely closed all browser tabs/windows and cleared my cookies and cache.

      Primary key confirmed as correct.

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        Have you tried another of the main common browsers? Chrome, Firefox, Safari?

  • Added rich text formula field. Added the code above. Added the field to the form. Created new record, made my selections, clicked the button. Got "Something went wrong; Try reloading this page."

  • Try making a formula rich text button with this code. It should work in either edit or add modes.  The code below works to add a record and then land the user on the newly added record in edit mode. 


    var text RID = IF([Record ID#] >0, ToText([Record ID#]), "%%rid%%");

    var text AddRecord = URLRoot() & "db/" & Dbid() & "?a=nwr";
    var text EditRecord = URLRoot() & "db/" & Dbid() & "?a=er&rid=" ;

    var text URL = 
    $AddRecord 
    & "&rdr=" & URLEncode($EditRecord) & $RID;


    "<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #1ba802; border-radius: 5px; color: #ffffff; display: inline-block; padding: 0px 0px 0px 0px; width:100px; text-align: center; text-shadow: none; border: 2px solid #1ba802; font-size: 12px \"href='"
    & $URL
    & "'>Save and Continue Editing</a>"

    //NOTE:  The %%RID%% does not seem to like being URLEncoded.

  • Denin's avatar
    Denin
    Qrew Trainee

    I tried this formula button on a new record, and then repeatedly editing the same record. It worked as expected every time (saved and loaded the same record again):

     

    var text rid = 
        If([Record ID#]>0,
            ToText([Record ID#]), // Record ID already exists
            "%%rid%%" // New record, no Record ID exists yet
        )
    ;
    var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;
    
    "<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Save & Keep Working - Rich Text</a>"

    Have you tried a different device just to rule out that it's a local issue?

  • I tried building a custom button using previous posts found and it resulted in the same issue as the native button. 

    Currently, the new records are being added directly from that tables home page using the +New button.

  • Denin's avatar
    Denin
    Qrew Trainee

    Have you considered using a save and continue formula button, and naming it something like "Get Price"?

     

    I tried to recreate the issue on my account. If I go to new record and then Save and keep working, it will do that, but the Save button reverts to regular "Save". If I click the dropdown, I can select Save and keep working. If I do that, it will then stay there. I had the same issue that after the first save, the "Save and next" button just disappears.

     

    I didn't have the save going to a new form issue. Are you reaching the form from a dashboard or is it embedded somewhere?