1

I have a form with additional form action buttons along with the default save and cancel. One is a reject button and the other is "bypass". I have the aforementioned "bypass" to "commit"and "redirect" but I would also like it to update a field not on the form ( but same list ) to a particular choice selection value. Is this possible?

0

Within SharePoint forms there is a check for a JavaScript function called PreSaveAction. You write the function itself into your code and SharePoint knows to look for it before committing the changes. The only problem I see is I am not sure if your code will force it to fire. I am going to assume it will based on your description above. Marc Anderson has a great write-up on PreSaveAction here: http://sympmarc.com/2009/05/28/validation-on-sharepoint-forms-part-four/

Once you have created the PreSaveAction function you can call your custom function to update the list. So now you have a couple options. You can make use of JCSOM or call a REST API using javascript as well.

To update via JSCOM, you can modify the function found here: https://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx#sectionSection2

A good read for updating via REST (a good practice to start getting into) can be found here: http://www.codeproject.com/Articles/990131/CRUD-Operation-to-List-Using-SharePoint-Rest-API

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.