Tag: sharepoint

Adding Events to SharePoint Fields

SharePoint Logo[This article should be considered deprecated.  The code represented has been improved, extended and made available as the DP_SharePoint Function Library.  All future effort will be applied there.]

The first article in this series dealt with obtaining a reference to a SharePoint field in Add and Edit forms.  One of the most common reasons to head down this path is to add custom validation to fields.  Often this requires adding events to (in the case of most fields) the onchange or (in the case of buttons) the onclick events of the fields.  Simply setting the event handler directly would work, but will eliminate any currently enabled handlers (such as those defined internally to SharePoint).

Instead I created two functions to abstract the standardized addEventListener() and (for older IE browsers) the attachEvent() methods.  They accept a reference to an HTML element (in this case a SharePoint form field), an event type and a function name to call when the event is fired.  The first adds an event to the passed element and the second (which is included for balance but which I’ve honestly never actually used) removes it.

(more…)

Obtaining a JavaScript Reference to a SharePoint Field

SharePoint Logo[This article should be considered deprecated.  The code represented has been improved, extended and made available as the DP_SharePoint Function Library.  All future effort will be applied there.]

I’ve been digging further and further into the bowels of SharePoint.  It’s not a pleasant place to dig.  At my company end-users and team-site owners are prohibited from doing any back-end development.  Additionally, due to various political issues, there are currently no available processes to contract for such work (although you can be added to an ever-growing waiting list).  The only development path open to site owners is client-side JavaScript.

On the team-site I manage one of the most used features is a custom list cataloging enterprise Incidents managed by the team.  Each incident is logged with information about the applications affected, the team engagement times and many other pieces of information.  The list feeds business customer reports and generates performance metrics for upper management.  With over 20 people on the team the quality of information can be rather shaky.  It would benefit greatly from some simple validation and a few points of automation.

(more…)

Formatting Excel Links for Import into SharePoint Lists

SharePoint LogoSpent way too long figuring this out today and thought I’d do an entry so that I’d remember it.  To set the stage my team manages emergency situations and restoration of service for over 800 enterprise applications.  As you might expect we have a SharePoint list of these applications with basic information about them.

One of the values is a unique enterprise-wide code that we’ll call the “AppCode”. One of the first things we do when a problem is reported is find that AppCode code for the application and search the system of record for detailed information about the application, the support, ownership, etc.  This isn’t difficult but it does take precious seconds.  Instead my plan was to create a link directly to the application profile in our list.

(more…)