Looking to add a button in form that will save the record and return to the Dashboard

  • 0
  • 1
  • Question
  • Updated 10 months ago
  • Answered
I'm needing a Save button in a form that will save the record I just created and return me to the Dashboard. 
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb

Posted 11 months ago

  • 0
  • 1
I suggest that you make a button on the Dadhboard to Add Record and it has an option as to where to return to after the Save. Will that solve your problem?
There is also another technique to use. Where is the User launching the Add Record from now? If launching off another record like a Parent, then there is another technique.
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
What I'm trying to do is have a button in a report on the Dashboard that will make a duplicate of that record and bring the user back to the Dashboard.  I've gotten close, but the record doesn't get saved.  I have been able to create a button that duplicates a record and takes you to edit mode for that new record, but I'm hoping to create a smooth flow that takes just one click.

Thanks,

Dana
I’m traveling now and just on an ipad and don’t have the time to post the full syntax.


If you post your current code I can probably adjust it.


The trick is to to change the code for the button which adds the record


This should solve your issue though. I’m using formula variables. If you have not used then before check the help.


Var Text URLONE = and code here to GenAddRecordForm;


Var Text URLTWO = and the URL of the Dashboard page;


$URLONE

& "&NextURL=" & URLEncode($URLTWO)
(Edited)
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
The code I'm using is: 

URLRoot()&"db/bnxn6mgw4?a=GenCopyRecord&rid="& [Record ID#]&
URLEncode(URLRoot() & "db/" & Dbid() &
        "?a=dr&rid=" & [Record ID#])

No matter what I do I end up at the edit page for the new duplicate record.
(Edited)
try this

var text URLONE = URLRoot()&"db/bnxn6mgw4?a=GenCopyRecord&rid="& [Record ID#];

var text URLTWO = " and paste in the full url of the Dashboard page including the https: and end in a semi colon.

for example

var text URLTWO = "https://mycompany.quickbase.com/db/xxxxxx";


$URLONE
& "&NextURL=" & URLEncode($URLTWO)
(Edited)
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
Still doesn't take me back to the Dashboard, just stays at editing the duplicate (unsaved) record.

I even tried to do it in two steps, where it brings me to the edit page and then I created a Save button that would bring it back to the Dashboard, but it won't save it.  Just shows the original records.

The best I could come up with, is a button to duplicate and bring to the edit duplicate record page, a Save button to save it and bring you to the saved record in View mode, then a button to return to the Dashboard. 

I very much appreciate your input.  I'm learning some things regardless, mainly the variables, which is very nice.  
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
If I could get it to do this in 2 steps, that would be good enough, but 1 step is ideal. 
Maybe I do not understand what you are trying to do.  I thought that you wanted to call up an Add Record form as a duplicate of an existing record and have the user make some edits and Save normally and land back on the Dashboard.  Is that what you are trying to do?  If so, please explain again what is not working, in a step by step fashion.

Or are you actually just trying fully duplicate a record without an manual editing and refresh the dashboard to show the duplicate record added?
Maybe our posts "crossed" just now.  Please answer my question above so I understand your goal here.
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
I was kind of trying to do both.   I have a report of Tasks on the Dashboard, and I have a button in it that I want to duplicate the record, save it and return you to the dashboard, showing that added record in the report.

I was also trying to do it the other way, where you click the button in the report and end up at the edit form where you could make some changes and then click a Save button that would take you back to the Dashboard, rather than the view mod of that new record.

My original question was mainly the first one, but both would be useful.  

Sorry for the confusion. 
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
Let me know if you need any further clarification on my last post.  Thanks 
Well my solution should work for the version where the user duplicates the record in Add Record mode and then Saves.

As for the button to actually AddRecird and return to the Dashboard, I will have to respond tomorrow. It’s past midnight in my current time zone as I’m traveling.
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
I understand, thanks!
Can you tell me your use case to want to exactly duplicate a record and not edit it. That sounds unusual.
Photo of Dana Hauser

Dana Hauser

  • 534 Points 500 badge 2x thumb
They want to duplicate a record and then have a different person who won't have the duplicate record function edit it later.  This client is a bit odd with some requests.

If I could get a button that saves and returns to the dashboard from the edit record screen, I can work with that.  I can't seem to get that function to work yet.  It will return to the dashboard, but won't save the record for some reason.  I can get a save button to work if you'r starting a new record, but if it's from the duplicate record it won't.  The built in save button saves it, but returns you to the record in view mode.  
Ok, I understand. I will have to test myself next eeek when I’m back in the office.
Meanwhile, can you post your current code?

Also, can you tell me if there are a lot of data entry fields on the form? There is another method using API_AddRecord but it takes some code to populate each field.