Discussions

 View Only
Expand all | Collapse all

URL Add Record then Save

  • 1.  URL Add Record then Save

    Posted 22 days ago

    I need an URL to allow me to Add a record, then save it, and then allow me to edit it. When hitting the add record button it creates a form filled out but the users need to add a document then hit a checkbox on a report link. When the users hit save the checkbox from the report link did not go through. They then have to edit the record and hit the checkbox again. This checkbox is in a report link that is to another table. I need it to where they don't have to keep going back to reselect the checkbox.

    This is the current formula:

    URLRoot() & "db/" & [_DBID_TABLE_1] & "?a=API_GenAddRecordForm&_fid_8=" & URLEncode ([Field 1]) & "&_fid_22=" & URLEncode("Document") & "&z="



    ------------------------------
    Ricky White
    Ricky
    ------------------------------


  • 2.  RE: URL Add Record then Save

    Posted 22 days ago

    So to clarify - you want them to add a record - then save - then do you intend for them to land in a way that they can check the box or have the box checked also upon save? If the checkbox is in another table - how are you identifying the record that needs to have the box checked? 



    ------------------------------
    Chayce Duncan
    ------------------------------



  • 3.  RE: URL Add Record then Save

    Posted 22 days ago

    Are you using an editable report link? Meaning when you try to use the editable report link in add mode, it doesn't add the child correctly (selecting a checkbox would in essence be adding a child). There are instructions in Kirk Trachys magic buttons to add a child record, save it, then land on the child record in edit mode. Is that what you need?



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



  • 4.  RE: URL Add Record then Save

    Posted 21 days ago

    If you want to essentially save and keep working, so that the record is saved and you land the user in the record in edit mode, then  you can provide a Formula Rich Text Button with this code below.  You would need to provide instructions to the users to use this special button and not the regular save button.  This should have the same effect as the user manually selecting the "split" drop down option on the regular Green save button to Save and Keep Working.  That option is a bit obscure so not really discoverable for regular users.

    This button will work in both Add Mode or Edit Mode.

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

    var text URL = URLRoot() & "db/" & Dbid() & "?a=er"
    & "&rid="& $RID;

    "<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #117a39; border-radius: 5px; color: #FFFFFF; display: inline-block; padding: 4px 4px 4px 4px; width:140px; text-align: center; text-shadow: none; border: 2px solid #0863f5; font-size: 12px \"href='"
    & $URL
    & "'>Save and Continue</a>"



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: URL Add Record then Save

    Posted 21 days ago

    Yes, I need it to save and keep working. It seems that the embedded report link doesn't save when it's just an added record. So, I will try this out.



    ------------------------------
    Ricky White
    Ricky
    ------------------------------



  • 6.  RE: URL Add Record then Save

    Posted 21 days ago

    It sounds like perhaps what you are describing is when creating a new record, the embedded report of related records, is not displaying as you're expecting. This is because the new record (in the process of being created) hasn't saved, thus doesn't have an ID under the hood. The related records can't be displayed until their parent record is saved linking their IDs together.

    Here are some things worth considering:

    • You may check a box in your formula url by setting the field to 1 (true)
    • e.g. &_fid_999=1 (where 999 is the ID of the checkbox)
    • In Table Settings -> Forms -> Properties tab check "Show save & keep working choice" as Mark eluded
    • Use Form Rules instead, to check the box when appropriate
    • Consider a formula checkbox instead (that self checks when conditions are met)?
    • Look into Pipelines to perform checking a box after the record is saved
    • The latter seems like overkill for this situation

    For me, it's unclear which table stores the checkbox data from your example. And what specifically it represents.

    Anyway, hope that helps!



    ------------------------------
    Brian Seymour
    ------------------------------



  • 7.  RE: URL Add Record then Save

    Posted 8 days ago

    Mark,

    I am trying to use this to create a button to save the record. What would I need to adjust from your formula above to do so?



    ------------------------------
    Stephanie Harris
    ------------------------------



  • 8.  RE: URL Add Record then Save

    Posted 8 days ago

    Try this

    This button will work in both Add Mode or Edit Mode.

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

    var text URL = URLRoot() & "db/" & Dbid() & "?a=dr"
    & "&rid="& $RID;

    "<a class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration:none; background: #117a39; border-radius: 5px; color: #FFFFFF; display: inline-block; padding: 4px 4px 4px 4px; width:140px; text-align: center; text-shadow: none; border: 2px solid #0863f5; font-size: 12px \"href='"
    & $URL
    & "'>Save</a>"

    // I changed the a=er (action = edit record)

    // to be a=dr (action = display record)



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------



  • 9.  RE: URL Add Record then Save

    Posted 8 days ago
    Edited by Mike Tamoush 8 days ago

    Stephanie,

    If you are testing Marks code, be sure that you change something in the record. The SaveBeforeNavigating only works as a 'Save' if something changes, so sometimes you will think it is not working, but really nothing changed so it just navigated away from the form. I can't tell you how many times this has tricked me (especially when using the code from an add record form - fields with default values don't appear to be changes so the added record would not auto save with the button push).



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



  • 10.  RE: URL Add Record then Save

    Posted 8 days ago

    Yes, Mike makes a good point.

    The button doesn't do anything at all unless the record has been what we call "dirtied". That means Some field has changed. What I do to prevent that behavious is in a hidden admin section I have two fields. One field is just a numeric data entry field and the other field there's a formula that takes that data entry field plus one. Then I have a Forum rule that says whenever those two are not the same then change the data entry field to the value in the formula field. That ensures that as soon as the record is open it gets dirty and my special save button will work.  



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------



  • 11.  RE: URL Add Record then Save

    Posted 8 days ago

    I previously had a URL formula field that was simple (below). It's not supported any longer. The link I have for EOTI submit concerns in my app has &ifv=1 at the end so it doesn't look like QB, just a webpage but that also removes the native Save button. So I had the custom Save button added to the submittal form.

    "javascript:void(DoSaveAdd())>Submit</a>"



    ------------------------------
    Stephanie Harris
    ------------------------------



  • 12.  RE: URL Add Record then Save

    Posted 8 days ago

    @stepanie

    Was that comment or a question.



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------



  • 13.  RE: URL Add Record then Save

    Posted 8 days ago

    An explanation in response to your comment about being sure to change something in the record. The Everyone On The Internet user is adding a new record, so I'm not sure that qualifies for changing something in the record. 



    ------------------------------
    Stephanie Harris
    ------------------------------



  • 14.  RE: URL Add Record then Save

    Posted 8 days ago

    When the EOTI user adds a record, as long as any single field on that record changes, it will be considered a change, and thus saved. I can't imagine someone will submit a form without selecting anything or typing in any single box. 



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



  • 15.  RE: URL Add Record then Save

    Posted 8 days ago

    It worked, thank you!



    ------------------------------
    Stephanie Harris
    ------------------------------