Create list item with button
Hi There,
I have built a custom SPForm that captures registration data for seasonal workers. When the season completes I want to have the user click a button that creates a new list item in a different list (season history) with a subset of data from the original form, and then blank out the values on the main form. I thought of doing it with a workflow, however if the workflow fails to trigger, then the information will effectively be lost.
I have seen some other posts on doing this, but I haven't managed to get it to work. Any guidence would be great.
I have built a custom SPForm that captures registration data for seasonal workers. When the season completes I want to have the user click a button that creates a new list item in a different list (season history) with a subset of data from the original form, and then blank out the values on the main form. I thought of doing it with a workflow, however if the workflow fails to trigger, then the information will effectively be lost.
I have seen some other posts on doing this, but I haven't managed to get it to work. Any guidence would be great.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi Mike,
You can add an item to another list via JSOM. Here is a sample:
https://msdn.microsoft.com/en-us/librar ... onSection0
You can add an item to another list via JSOM. Here is a sample:
https://msdn.microsoft.com/en-us/librar ... onSection0
Thanks Dmitry. I've been trying exactly that, I've used that code in the SPForms JS Framework, set the function to global, so I can call it from an OnClick of a button, but the actual adding of the item fails. No error, just simply nothing happening. I know the OnClick call is working, because if I simply call an alert, that works fine. I'll keep pluggin away until it works, but any other ideas would be great.
Thanks
Mike
Thanks
Mike
-
- Information
-
Who is online
Users browsing this forum: No registered users and 12 guests