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 ...


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

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) });


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

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

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

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]::...


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

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

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

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

Yes this is possible. I have successfully used the the onvaluesetfrompicker function of a Date field, like so: $('#specificDateFieldID').get(0).onvaluesetfrompicker = DatePickerChanged; function DatePickerChanged() { // Do stuff } But this was in SharePoint 2013. It seems from this that it should also work in SharePoint 2010 with custom forms, but not ...


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 ...


3

List GUID should be added without { }: <a href="http://<SITE_URL>/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List=<LIST_GUID>&CacheControl=1&ID=<ITEM_ID>&Using=event.ics"> Add to my calendar <a> The link should be like this: https://yourtenant.sharepoint.com/sites/yoursite/_vti_bin/owssvr.dll?CS=109&Cmd=...


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

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

I have done the below in SharePoint 2010, hope it will work in SharePoint 2013 also. To bring a Pop UP, you can make use of PreSaveAction function in your newform.aspx. In the newform.aspx of the list, you have to use content editor web part with the below javascript. <script type="text/javascript"> function PreSaveAction() { alert('Thank you for ...


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 ...


2

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


2

SharePoint 2013 supports remote event receivers. You can get the job done through it.


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

After a Save the page will get refreshed and the context is lost. The only option I can think of is to handle the button Save click event using jQuery. Other workaround Starting a Workflow on item create Handling Event Receiver ItemAdded Set SOURCE parameter so after item add it goes to a particular page. On that page add a window.load handler and execute ...


2

Yes it's same. SharePoint 2010 Base class URL : https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverbase(v=office.14).aspx SharePoint 2013 Base class URL : https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverbase.aspx Please check both URL.


2

For chrome the variable name is different, so following should help: $('#txtSearch').keypress(function(e){ var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; if(key == 13) $('#btnSearch').click(); }); }); e.charCode is used in Chrome


2

Edit count: Use versioning, and show the version number. When using only Major versions, the version number will incrementally increase +1 each time the document is revised. Download count: Note: this isn't available for O365/SharePoint Online! In your Site Collection's root's site settings, navigate to Site Collection Audit Settings. Enable the auditing ...


2

In calendar view, we cannot filter by Start Time column directly. There is a workaround for the issue. We can create another column with “Date and Time” column type. And copy the value of the Start Time column to the new column. Then filter by the new column in calendar view. In calendar view, we cannot define item limit directly. There is a workaround ...


2

Group Calendar is available in Modern page web-part gallery. I sync the events from your outlook. Also, you can segregate these based on the O365 Groups/security groups. In one Homepage dashboard, people can refer the events which are related to their team! Refer SS:


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