Skip to main content
Question

My Formula Save Button is Creating 2 Records at a Time

  • August 7, 2019
  • 0 replies
  • 14 views

Forum|alt.badge.img+6
I am using:

"<a id='saveButton' class='Vibrant Primary' onclick='DoSave()' href='#'>Submit</a>"

After I click this, 2 records are created. There should only be one.
This topic has been closed for replies.

AdamKeever1
Forum|alt.badge.img+2
  • Quickbase Alumni
  • August 7, 2019
When I use your code Kelly it performs the save as normal, creating only one record when used on a new record and creating no new record when used after editing an existing record.

What is the context in which you are using the save button and are seeing it create 2 records?

Forum|alt.badge.img+6
  • Author
  • Quickbase Alumni
  • August 7, 2019
Every record was duplicated. I'm not sure why. Oddly enough, I switched it out for code I had for another save button, which is essentially the same, and it was fine. Here's what I used...

var text bgcolor = "#4b72b0";
var text txtcolor = "white";
var text style = "style=\"text-decoration: none; background:" & $bgcolor & "; border-radius: 5px; padding: 10px 24px; margin-bottom:5px; width: auto; font-weight: normal; font-size: 12px; text-align: center; display: inline-block; color: " & $txtcolor & "; font: normal 700 24px/1 \"Calibri\", sans-serif;";
// End button style

"<a " & $style & " onclick='DoSaveAdd()'href='#'>Submit</a>"

Not sure why this would make a difference, but it did.

AdamKeever1
Forum|alt.badge.img+2
  • Quickbase Alumni
  • August 7, 2019
I can't explain it. I get the same result with both buttons and do not experience the duplication that you experienced.

Glad you have a solution working properly for you.

Forum|alt.badge.img+6
  • Author
  • Quickbase Alumni
  • August 7, 2019
Thank you, it's weird, but I figured I would leave this up just in case someone else experienced the same thing. It happened all day as other users made entries and then I tested to verify. The minute I changed the code, it stopped.