Forum Discussion
ChrisSwirtz3
Qrew Member
Hey Mark,
Thanks for this! It actually worked great, for the most part anyway. I created a button to go on the form and on the reports on the home page that takes the user to that alternate form I created which displays the warning message that says to either continue cancellation by clicking the cancel button below or to click on your home button. Might add another button to take them back to edit mode on the main form so they can continue working if they want. The problem I run into is the Cancel button the Cancellation form is setup to change the Status field and then navigate to the Home Page. But in order to change the Status field it needs to look for the Record ID, which is not available when Adding a new record. Clicking the button to take the user to the Cancellation page does save the record first before opening the next Form, but the Cancellation form opens in Add mode versus Edit mode of the record that was just created. Any ideas on how to modify this option so it works in Add mode too?
------------------------------
Chris Swirtz
------------------------------
Thanks for this! It actually worked great, for the most part anyway. I created a button to go on the form and on the reports on the home page that takes the user to that alternate form I created which displays the warning message that says to either continue cancellation by clicking the cancel button below or to click on your home button. Might add another button to take them back to edit mode on the main form so they can continue working if they want. The problem I run into is the Cancel button the Cancellation form is setup to change the Status field and then navigate to the Home Page. But in order to change the Status field it needs to look for the Record ID, which is not available when Adding a new record. Clicking the button to take the user to the Cancellation page does save the record first before opening the next Form, but the Cancellation form opens in Add mode versus Edit mode of the record that was just created. Any ideas on how to modify this option so it works in Add mode too?
------------------------------
Chris Swirtz
------------------------------
MarkShnier__You
3 years agoQrew Legend
Can you post your code for the cancel button?
Are you asking for the cancel button to work in Add Mode? Like a user would be adding a record in cancelled Status?
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
Are you asking for the cancel button to work in Add Mode? Like a user would be adding a record in cancelled Status?
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
- ChrisSwirtz33 years agoQrew MemberHey Mark,
This is the code to get the user to the "Cancel Form"
URLRoot() & "db/" & Dbid() & "?a=er&dfid=81&rid=" & [Record ID#]
And this is the code for the actual "Cancel" button on that form.
URLRoot() & "db/" & Dbid()
& "?a=API_EditRecord"
& "&rid=" & [Record ID#]
& "&_fid_1161=Cancelled"
& "&rdr="
& URLEncode(URLRoot() & "db/bsd4f85xs")
Which works perfectly when they are working with a record that has been saved and has a Record ID. However, when adding a new record, there is no Record ID established yet. Now, when I click on the button to navigate to the Cancel Form from a new unsaved record, it does save the record first because I have the setting turned on to do so, but when it opens the Cancel Form, it remains in "Add" mode and doesn't capture the Record ID that was created when it saved and navigated to the other form. It's almost as if the formula needs to save the record and reopen it as is then run the code to navigate away so the new form so it reads the Record ID at that point.
------------------------------
Chris Swirtz
------------------------------- MarkShnier__You3 years agoQrew LegendTry this for the Button to get to the cancel form. It should work in all modes, add, edit, view,
var text rid =
If([Record ID#]>0,
ToText([Record ID#]),
"%%rid%%");
var text url = URLRoot() & "db/" & Dbid() & "?a=er&dfid=81&rid=" & $rid;
"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Your button words go here like Cancel Form</a>"
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- ChrisSwirtz33 years agoQrew MemberYour takes me to the Cancel Form no problem, but I get this error message when I click on the cancel button from the Cancel Form.
This XML file does not appear to have any style information associated with it. The document tree is shown below.<qdbapi><action>API_EditRecord</action><errcode>30</errcode><errtext>No such record</errtext><errdetail>Missing "rid" parameter.</errdetail></qdbapi>
The problem isn't getting to the Cancel form while in add mode. It is capturing that Record ID between so that theoretically when I get to the Cancel Form, it should be in edit mode of the Record that was just created. But that isn't what is happening, it's like it is saying that it is saving a record but then just reopening the add record screen in a different form.
------------------------------
Chris Swirtz
------------------------------