Forum Discussion

KellyBianchi's avatar
KellyBianchi
Qrew Assistant Captain
6 years ago

My Formula Save Button is Creating 2 Records at a Time

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.
  • 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?
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    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.
  • 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.
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    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.