fix: handle multiple webform for same doctype #21220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you want to create multiple web forms for the same doctype and
allow_multiple
is not set.If the user already submitted a web form before and now is asked to submit again for another webform for the same doctype he will not be able to since the old record already exists and it will be displayed if he tries to hit
/new
E.g.
We create separate web forms to get a count of employees coming for the company offsite and we store all the data in the same doctype named Offsite.
At the start of the year, we went on our first trip and created a web form named Bhopal Offsite now again at the end of the year we are planning to go for another trip so need to create another web form named Igatpuri Offsite but since each employee have already submitted a response through Bhopal Offsite webform if we create a new web form for same doctype they will be not able to submit a new response since old offsite record already exist.
Now after the fix, we can add a condition in Webform which will be evaluated and if the record does not exist he/she will be able to submit a new response