0

My requirement is like - When an item is added to a list, a log should be added to another list? And this needs be done using JSOM. is there a way to achieve this using JSOM?

  • There are many ways of adding items to a List (QuickEdit, REST, etc.) Are you factoring all these things into your requirements? – jasonscript Feb 13 '15 at 6:25
  • My requirement is not adding list item, but to handle the event when the item is added – Bishnu D. Feb 13 '15 at 8:34
  • why are you not using workflows? Is there any specific reason? – Amit Feb 13 '15 at 11:32
  • JSOM is not an appropriate way to handle this scenario, for the reasons jasonscript has noted. – Derek Gusoff Feb 13 '15 at 20:58
0

Assuming that your scenario is O365, the standard approach would be to use Remote Receivers. Those xan be attached to the list and perform operations when events occur, such as adding, removing, modifying, etc.

The following post is a good starting point: https://msdn.microsoft.com/en-us/library/office/jj220043.aspx

0

You have two options here: 1.) Use Jquery to add an additional click event on Submit button and write JS code to make entry to the log list. To achieve this simply add a content editor on you new item form. Something similar to https://stackoverflow.com/questions/6527783/call-submit-button-function-from-jquery

2.) Use the Pre save event of Sharepoint https://deannaschneider.wordpress.com/2012/12/03/sp2010-using-presaveaction-on-custom-forms/

  • Neither of these approaches will work for quick edit, nor will they work for list items created programmatically. – Derek Gusoff Feb 13 '15 at 20:57
  • He wanted to do it using JSOM seems like he does not have option to do programming. – Mohit Feb 14 '15 at 8:33

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.