StratusForms icon indicating copy to clipboard operation
StratusForms copied to clipboard

Clone a record

Open btroop202 opened this issue 6 years ago • 2 comments

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?

btroop202 avatar Sep 27 '18 09:09 btroop202

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?

davidcfk avatar Sep 28 '18 00:09 davidcfk

Hey thanks David, Just read your post and will attack this in the morning.

btroop202 avatar Oct 01 '18 14:10 btroop202