Hot answers tagged

15

I managed to fix this error by following these steps: Stop the Windows SharePoint Services Timer service (Found in Windows Services) Navigate to the cache folder In Windows Server 2008, the configuration cache is in the following location: Drive:\ProgramData\Microsoft\SharePoint\Config Locate the GUID folder that has the file "Cache.ini" (Note: The ...


11

Form MSDN : SPEventReceiverBase.DisableEventFiring Method Prevents events from being raised. So someone could think that all events are disabled (all items, all events, all receivers). But: How DisableEventFiring / EventFiringEnabled works The setting (DisableEventFiring in 2007 and EventFiringEnabled in 2010) must be for the current event handler; ...


8

To intercept all modals if you don't have control on their triggers, you might want to do a "catch all" proxy pattern: SP.UI.ModalDialog.showModalDialog_old = SP.UI.ModalDialog.showModalDialog; SP.UI.ModalDialog.showModalDialog = function(options) { console.log(0); //do stuff SP.UI.ModalDialog.showModalDialog_old(options); }; You will want to do ...


5

You can access the content from the ItemAdding event by using Request.Files property of the context. Try something like this : HttpFileCollection files = HttpContext.Current.Request.Files; foreach (String key in files.Keys) { if (collection[key].ContentLength > 0) { Stream stream = files[key].InputStream; ...


5

You could still use a list, just use some other additional pieces. You could have a list that contains the event and the limit, a column for number registered, and a column for available spots (which is the limit less the number registered). Then you can simply go in and add a link to register (the registration is contained in another list) when you enter ...


5

If you have Minimal Download Strategy enabled, you need to do it like this: $(function () { ExecuteOrDelayUntilScriptLoaded(function () { if (typeof asyncDeltaManager != "undefined") asyncDeltaManager.add_endRequest(runYourCode); else runYourCode(); }, "start.js"); }); function runYourCode() { //your code ...


4

I think you will need to have some algorithm for it. Below is one which may help: Maintain the deleted sites Url and GUID in a list.You can do it using SPWebEventReceiver.WebDeleted.Also,Before it gets deleted, modify its home page to a new html like page that says "Under Construction". Create a job and monitor the list for deleted site restoration. To do ...


4

I don't know if this is what you are after, but I post anyhow. If you make a custom call to the modal dialog, you can execute your own code before you show the dialog. //Dialog Opening function OpenDialog() { var options = SP.UI.$create_DialogOptions(); options.url = '/Pages/myPage.aspx'; options.dialogReturnValueCallback = Function....


4

Depends on how your requirements fit in 1. Event handlers Can't be manually initiated - workflows can be initiated either automatically or manually. Event Handlers can be Synchronous or Asynchronous - Workflows are always async (They executes after the operation) In Event Receivers we can cancel the operation (such as add/update/delete) - But in Workflows ...


4

Here's a small snippet from my blog which should get you where you need: _spBodyOnLoadFunctionNames.push('calendarEventLinkIntercept'); // hook into the existing SharePoint calendar load function. function calendarEventLinkIntercept() { if (SP.UI.ApplicationPages.CalendarNotify.$4a) { var OldCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4a; SP.UI....


3

Here's how I did it but in most situations it is best not to disable event firing outside the event handlier/receiver: $web = Get-SPWeb -Identity http://yoursharepointweb #FILL IN WITH YOUR WEB URL $list = $web.Lists["YOUR LIST"] #THE LIST NAME FOR YOUR LIST $item = $list.GetItemById(YOUR NUMERIC LIST ITEM ID) #THE ITEM ID $assembly = [Reflection.Assembly]::...


3

You Shouldn't. DisableEventFiring is only meant to be used inside EventReceivers. The main purpose is to prevent looping when they update items. If you really REALLY want then it's almost identical to you c# code: $receiver = New-Object "Microsoft.SharePoint.SPEventReceiverBase" $type = $receiver.GetType() [System.Reflection.BindingFlags]$flags = [System....


3

As James said, you could create a timer job to sync profile changes with the external system. But, to detect the changes in user profile properties, I would suggest you to look into UserProfileChangeCollection because it contains a complete log of changed user profiles. using (SPSite site = new SPSite("http://server1")) { ...


3

Not really - the User Profile properties aren't stored in a list (which is where Event Receivers are registered) - they're all stored in the User Profile Database which is managed by the User Profile Service Application. If you want to sync profile changes with an external system, you can write a Timer Job to look up the user profile properties and ...


3

The ItemAdded is called just once on you event receiver; an item can be added just once. The ItemUpdating and/or ItemUpdated may be called multiple times. It will depend on what receivers or what workflows are active in the list and what method they use do to update the list item. Calling SPListItem.Update() triggers the events while calling the SPListItem....


3

Being a complete InfoPath-phobe, I'd opt for using just a standard list, with the columns you need, and the logic for checking the limit of RSVPs implemented inside an Item Event Receiver, which handles ItemUpdating. You could put the configuration of what RSVP list has what limit into another list (columns for this config list could be, for example, URL ...


3

I'm assuming you have some kind of unique ID that will be used in your list/library items/documents. One approach that we are currently looking at: Add a custom webpart to your "view form" and "edit form" pages (either in designer or using the ?toolpaneview=2 URL parameter). On load, use a web services javascript call to reach into your data source and ...


3

What I'm doing is that I change the "Source" parameter in the URL, so when the user saves the form, he's then redirected to a special HTML page that is doing some stuff, and after that redirected to the original page. First, at the beginning of my form I call a JavaScript page that will: record the actual "Source" into localStorage stop the page loading ...


3

This was bugging me for days. The cursor is added to the field every time you select a date. Listen on the input field date picker prints your date to using "focus". $("[title='Date Received']").on("focus", function(event){ var daterecieved = $(event.target).val(); console.log(daterecieved) });


3

If you are using SP 2013, you can SPSecurityEventReceiver. A good resource on this is: http://www.timferro.com/wordpress/archives/737. Excerpts: [This Server Side and Remote Event Receiver] Provides methods [in 5 main categories: 1. Group Events, 2. User Events, 3. Inheritance Events, 4. Role Assignment Events, and 5. Role Definition Events] to trap ...


3

You can't actually stop the Updated event from firing. There's a full lifecycle of events that will always run, so the trick is to check for certain conditions within a given event to determine whether or not you want your code to run at that time. This blog does a good job of walking through the events, and why they fire. Ultimately you can look at a ...


2

SharePoint internally uses the function ExpGroupRenderData to expand or collapse a group of a grouped view. You need to overwrite this function to fire your custom JavaScript code. UPDATE: Here's the original script code taken from init.js: function ExpGroupRenderData(htmlToRender, groupName, isLoaded) {ULSxSy:; var tbody=document....


2

Is this really important? LCID should be handled by the user profile itself (user language). Per design page views are not tracked (audit) and the argument here are again performance. Even if you threw in a webcontrol that monitored usage, your caching strategy would be limited. You could consider setting some of the values in a cookie, or doing the check ...


2

If it is a partial refresh of the page, like in UpdatePanel, jQuery(document).ready(), or jQuery(window).load() don't fire. You must find some event that fires. You can start to lab with PageRequestManager. It helped me in my UpdatePanel. var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(doSomethingGreat);


2

If you're going to use the SharePoint Extensions for Visual Studio 2010 - it's a requirement to have VS and SP on the same box. On the other hand - you can handcraft a WSP using a simple assembly project, writing the XML files manually, hacking a DDF file and run makecab. OR you can use WSPBuilder and tools like that.


2

I have seen this event type value when using the expand recurrence option in a CAML query. Each occurrence in the series, except series exceptions or deletions, will have an EventType value of 5. Sample code: SPList list = SPContext.Current.Web.Lists["Calendar"]; SPQuery query = new SPQuery(); query.ExpandRecurrence = true; query.Query = string.Concat( ...


2

AFAIK, that information is not stored in a plain list and you cannot add even receivers when a user or group is added or permissions are assigned. Applicable to MOSS 2007 and SharePoint 2010. Having said that, Microsoft realized a genuine need of such scenarios and made the events available in SharePoint 2013. Check this link: http://www.learningsharepoint....


2

There is a KB for this. http://support.microsoft.com/kb/2694420 When the OnWorkflowActivated event fires, SharePoint delivers one event for each OnWorkflowItemChanged activity inside the state machine workflow. For example, if there are 3 OnWorkflowItemChanged activites inside the state machine workflow, then there will be 3 subscriptions for the ...


2

There is no SharePoint event for view added. These are the available event receivers


2

Looks like _layouts/15/clientpeoplepicker.js is running DeleteProcessedUser, OnControlValueChanged and OnControlResolvedUserChanged when I try removing someone from the PeoplePicker control in my SP2013 dev environment. There's quite a few other functions being called from the clientpeoplepicker.js file also, but these seem to be the most relevant. Hope ...


Only top voted, non community-wiki answers of a minimum length are eligible