I have SharePoint Document library in which there is InfoPath form. There is one event receiver which works on Item Added event. Version setting for the library is "Create a major version". When I change anything in the form, instead of creating its version, it is creating a new form in the library with the same property except the change. Am I missing anything in settings ?
The issue with you is that here a new document is uploaded so its not maintaining the versions.
When I was having the same requirement I have achieved this without having event receiver. I followed
- On load of the InfoPath form I stored the current name of the document in the hidden control on InfoPath.
- In the submit rule I have used the name of the document stored in the hidden control. And due to this I was able to generate the versioning of the documents and new document was not created.
You can try with this approach once, it solved the requirement.
Also verify once following versioning setting: