I was working on a project, and I needed to write a new function which calculates yesterday’s date and if yesterday was a Sunday, the function needed to return last Friday’s date. The first part of my function checks to see if the date supplied to the function is at least Tuesday. If the date passes that check, then we subtract one from the date and return the date.

If the date failed the first check, then we subtract 7 from the date to get a day last week, and then subtract the day of the week from that day in order to get to the beginning of the week. Finally we add 6 to that day in order to get Friday.

In this example, I will be using an “Announcements List,” with the default fields, and using and Windows Form App, I will load data from this list into a DataGridView. You will need to download and install the SharePoint Server 2013 Client Components SDK from Microsoft.

After you have installed the SDK, You will need to add the following two references to your project: Continue Reading

I am reluctant to write a post on authenticating users with ColdFusion and Active Directory trusts because I am not confident my method is the most efficient solution. However, I realized that something in this post may help another developer. Before I start, I should explain the Active Directory paradigm and the basic requirements my solution addresses.

In the image below, I’ve created a fictional diagram of a trusted Active Directory for the purpose of this article.

I haven’t posted in a while, but behind the scenes I have been working with SharePoint 2013 Client Object Model. The SharePoint 2013 Client Obect Model is a set of libraries and classes with which you can consume SharePoint data through a specific object model that is a subset of the SharePoint Server Object Model.

I’ve ran into a few issue trying to use the sp.js file on custom aspx pages within SharePoint Designer. After creating a new aspx file add the following lines between the <head></head> tags.

[script type=”text/javascript”]
$( document ).ready(function() {
/* I have three “Choice fields” on my form that should be clear of any values before the use begins to work on the form.*/
$(” #ctl00_ctl37_g_2b0481ff_2742_407e_8a04_ba29ca966562_ff21_ctl00_DropDownChoice ” ).val(“”).change();
$(” #ctl00_ctl37_g_2b0481ff_2742_407e_8a04_ba29ca966562_ff31_ctl00_DropDownChoice ” ).val(“”).change();
$(” #ctl00_ctl37_g_2b0481ff_2742_407e_8a04_ba29ca966562_ff51_ctl00_DropDownChoice ” ).val(“”).change();
});