StratusForms
StratusForms copied to clipboard
Clone a record
I was wondering if anyone has done this before, I have a use case where a user wants to be able to onen a record and then can click on a button to clone it (sine 90% of the input will be the same). Is there a way to force StratusForm to do a insert instead of an update?
Looking at how it calls the SPServices, if you can find a way during the StratusFormsSubmit to update the formID (it's likely going to look something like the following):
- edit the StratusFormsSubmit in stratus-forms1.5.js to include amongst it, an option for formID
- set formID to 0 when calling it. It will stop the function from then replacing it with the global ID value that was originally set during init.
- This then goes into the SPServices, it'll leave the ID=0, and then should result in a new entry with the existing fields.
Your completefunc should remember to redirect it to the new cloned copy's view, hopefully...
see if that helps?
Hey thanks David, Just read your post and will attack this in the morning.