Hi,
We need to write some custom logic once user add any item in custom list in SharePoint 2013 Online (Office 365 E3 version).
Any approach, information, code about this would be greatly appreciated. Thanks!
Technology Tips and News
Hi,
We need to write some custom logic once user add any item in custom list in SharePoint 2013 Online (Office 365 E3 version).
Any approach, information, code about this would be greatly appreciated. Thanks!
Hi Shailendra,
There are two different approaches we can follow
1) PreSaveAction() - Executing certains logics before saving the item to list
https://social.technet.microsoft.com/Forums/sharepoint/en-US/86fe14fc-f353-4521-bf88-fd7fcabaa768/using-presaveaction-in-newformaspx-in-sharepoint-list?forum=sharepointgeneralprevious
2) ItemAddedEvent Receiver - Execute custom logic after adding item to the list.
http://onceinawhilescribble.blogspot.in/2013/05/creating-simple-event-receiver-in.html
Thanks.
Hello Shailendra,
You can add some JS logic in CEWP on your new/edit list forms something like below.
<script src="/sites/dev/Style%20Library/Custom/Grid/jquery.min.js"></script> <script type="text/javascript"> function PreSaveAction() { if ($("select[title='Status'] option:selected").val() == 'Closed') { alert("You can't reopen this item") return false; } else { return true; } } </script>
Thanks.
Hi,
Thanks, can we use this code in Sp13 Online version, also we don't have Azure?
Yes, you can use it in SP2013 Online.
Thanks.
Hi,
I suppose there is no method called PostSaveAction.
If you wanna do certains action after saving the item, use event receiver or workflow based on your requiremnt.
Thanks.
Hi,
Few different options:
So I would like to suggest to check workflow solution.