bizform on second submit, create a new record (not update first one). Clear submission ID

Tom Wisneski asked on June 8, 2020 15:28

Question. A calculator using a Bizform submit, so it saves the values. The user should have the option to calculate and calculate again - with new values in the input fields. Asked a similar question before with another project. Never got a resolve on this. Is there a way to clear the submission ID so a second "click" or submit while on the page creates a new record and not just updates the initial record. Thanks.

Correct Answer

Juraj Ondrus answered on June 9, 2020 07:00

Well, the online forms were designed to collect data and not to do calculations. So, as Brenden said, I would rather create a custom web part for this custom need.
Anyway, have you tried using the option "Continue editing"? This will leave the entered values in the form and when you edit them and submit, it creates a new record - it looks like this is what you are looking for.

1 votesVote for this answer Unmark Correct answer

Recent Answers


David te Kloese answered on June 8, 2020 15:40

Have you tried using the Clear Form option?

https://content.screencast.com/users/DavidTK/folders/Jing/media/e461dc1e-6c43-4cc4-9bc8-b1506bde79b9/2020-06-08_1538.png

And did you base your Web Part on the out of the box forms Widget?

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 8, 2020 15:47

I beleive I mentioned previously, use custom code for this. While you can use the BizForm object to store the records, use a custom web part to perform your logic to insert a new record each time.

2 votesVote for this answer Mark as a Correct answer

Tom Wisneski answered on June 8, 2020 15:49 (last edited on June 8, 2020 15:51)

David. Yes, which is the sensible way with this question. However I need to show the values entered - it is a calculator. So the user inputs the values, then clicks submit. The records get saved for future viewing of what was calculated. However, since the user is not leaving the page you would like the user to see what was entered and the results prior to another try (or another submit). I was trying with jQuery to just store the previous values entered grabbing them from hidden fields I placed the values in during the method OnBeforSave. However one issue is that there is a dropdown that has a dependent field. This First dropdown is for Frequency (50Hz / 60Hz), then depending on what the user selects here...then a second dropdown is populated with generator models. Now the first dropdown I can use jQuery to set the value to 50/60 after the submit. However I have to get the dropdown to 'fire' in order to set the second dropdown with the Generator products. This I have had no luck in. This is a lot of fudging around...just curious if there is a Kentico way to change the submission ID after a submit click? Thanks.

1 votesVote for this answer Mark as a Correct answer

Tom Wisneski answered on June 8, 2020 16:22

Brenden...it just shows how lacking Kentico is in that it offers dependent fields and such. However when basic programming needs to be done - it always has to be custom. Thanks. Sorry that the question irritated you so. :)

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.