Hi All

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hi All,

We are using clone button on a detail page and there is Save custom button on Clone page. Everything is working fine from cloning the record to saving clone record. But we have faced a strange issue, when user tries to click 2 time on the Save button on clone page, a javascript popup get displayed and it asked for staying on the page or leave the page. when we select leave the page, we see error on the page and record with blank value gets created in the system
The URL shows something like this ...
https://nbcusales--sandbox1--c.cs25.visual.force.com/apex/pageName?Id=clone_1

Is anybody have idea why javascript popup gets displayed while clicking 2 time on the save button and why we get this Clone_1 ID instead of the new record ID?

Regards
Rahul
Photo of Rahul

Rahul

  • 542 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Hi Rahul

If the user presses save twice the save process gets interupted and starts working on the remaining values in the metadata. What you might want to do is to set an additional action on the custom save that will update a Ui only field to true and then disable the Save button based on the true value.  This should stop the users from pressing the save button twice.  The other method, and probably the best one, would be to use multiple actions on your save button and block the Ui (with a message Saving...) until the save is complete and then unblock the Ui after.

Good luck 
(Edited)
Photo of Rahul

Rahul

  • 542 Points 500 badge 2x thumb
Hi Gregg, thanks for you response and I have resolved the issue with the Blocking UI feature. But Still I have question in my mind that why user is allowed to click two times on Save button ?

Ideally once the Save is clicked, User shouldn't be able to click it again, but this is something strange what I have seen on Save button. Another thing is what exaclty is Clone_1 which got appended in the ID in the URl ?

your inputs will be highly appreciated.

Regards,
Rahul
(Edited)
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Hi Rahul

The Save button is an independent component and is customisable. To make it not active after a single execution would be limiting to some other type of functionality that it could be used for.

Clone_1 is the Salesforce backend code that generates this extension.  You can use multiple actions in Skuid and when you save the record you have the opportunity to use your own naming conventions.

 

Good luck.