How to get the GUID of a SharePoint List

Posted by KansasCoder / Category:

1. Go to the list settings page.
2. Right click on "Title, description and navigation" and copy the shortcut.

3. Ctrl-V into notepad.
4. Everything after "List=" in the string is your URL Encoded GUID for the list.

This can be decoded with Microsoft.SharePoint.Utilities.SPEncode.UrlDecodeAsUrl();

or as needed by the wonderful utility at meyerweb.com

70-630 Exam Areas

Posted by KansasCoder / Category: ,





Skills Being Measured
This exam measures your ability to accomplish the technical tasks listed below.The percentages indicate the relative weight
of each major topic area on the exam.


Configuring Microsoft Office SharePoint
Server 2007 (15 percent)


  • Configure site management

  • Configure personalization

  • Configure users and groups

  • Configure alerts

  • Configure Single Sign-on (SSO)
Managing Search (16 percent)

  • Configure Search Center

  • Configure Search settings

  • Monitor Search activity
Configuring Content Management (16
percent)


  • Configure document management

  • Configure records management

  • Configure Web content management

  • Manage policies and compliance

  • Configure workflow
Configuring Business Forms (12 percent)

  • Configure Forms server

  • Manage data connection files

  • Configure Web service proxy

  • Manage form templates
Managing Business Intelligence (10
percent)


  • Configure Excel services

  • Configure Report Center

  • Configure Web parts

  • Configure Business Data Catalog (BDC)
Managing Administration (21 percent)

  • Manage the central administration interface

  • Manage the shared service provider

  • Use the STSADM tool

  • Configure usage analysis and reporting
Deploying or Upgrading Microsoft Office
SharePoint Server 2007 (10 percent)


  • Manage Microsoft Content Management Server (CMS) assessment

  • Configure shared services

  • Manage Business Intelligence tools

  • Manage portal and site migration

  • Finalize upgrades

Update your path in life!

Posted by KansasCoder / Category: ,

If you plan on using the dos prompt to compile your C# and haven't already done so you will want to add the path to csc.exe to your environment variables. It will allow you to open a dos prompt window and type "csc yourCsFilename.cs" and go without having to navigate each time to the location of csc. A healthy, carpal tunnel free programming life is built on saving key strokes so find and use your shortcuts!! Move your mouse as far away from you as possible and just start looking up and using the shortcuts that appear on your menus! It will greatly increase your efficiency over time.



To do this on Windows 7 and Framework 3.5 right click 'My Computer' and click on 'Properties' then click on 'Advanced System Settings' over on the left. Click on the 'Advanced Tab' and then the button at the bottom that reads 'Environment Variables'. Put your cursor in the second box (System variables) and scroll down until you find the one named 'Path'.

Click 'Edit' then remove your hand from the mouse ( if you are not already using the tab key)!


Hit your 'End' key and paste this whole string in there ;C:\Windows\Microsoft.NET\Framework\v3.5\ using 'ctrl - V'...of course.


'OK' your way out of all the windows, open a dos prompt (using the keyboard and type csc /help ( that's 'csc' a space and then '/help')


you should get a bunch of help scrolling past you in the dos window. If you don't open Windows Explorer and paste the path to csc.exe into it 'C:\Windows\Microsoft.NET\Framework\v3.5\' and if you don't get there then you need to install framework 3.5. Search your Framework directory for 'csc'exe and paste that into the Path environment variable instead.

Live long and prosper!

Creating Military Julian using XPATH in InfoPath 2007

Posted by KansasCoder / Category: ,

Ok..codeless in the subject is a bit of a misnomer..there is code BUT there is no code-behind. Below I'll show you how to create an ordinal day and a military julian day utilizing the XPath.
 
Create a field in your InfoPath DataSource called Military Julian and paste the function into it's default value:

 
concat(substring(substring-before(now(), "-"), 3, 2), (((substring-before(substring-after(substring-after(now(), "-"), "-"), "T")) + floor((153 * ((substring-before(substring-after(now(), "-"), "-")) + 12 * (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12)) - 3) + 2) / 5) + (substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) * 365 + floor((substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) / 4) - floor((substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) / 100) + floor((substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) / 400) - 32045) - ((substring-before(substring-after(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-"), "T")) + floor((153 * ((substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) + 12 * (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12)) - 3) + 2) / 5) + (substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) * 365 + floor((substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) / 4) - floor((substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) / 100) + floor((substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) / 400) - 32045) + 1))
 
You now have the Military Julian in the format of  YYNNN, where NNN is the Ordinal Day.
 
If you want only the Ordinal Day of the year use this function instead:
 
(((substring-before(substring-after(substring-after(now(), "-"), "-"), "T")) + floor((153 * ((substring-before(substring-after(now(), "-"), "-")) + 12 * (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12)) - 3) + 2) / 5) + (substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) * 365 + floor((substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) / 4) - floor((substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) / 100) + floor((substring-before(now(), "-") + 4800 - (floor((14 - substring-before(substring-after(now(), "-"), "-")) / 12))) / 400) - 32045) - ((substring-before(substring-after(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-"), "T")) + floor((153 * ((substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) + 12 * (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12)) - 3) + 2) / 5) + (substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) * 365 + floor((substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) / 4) - floor((substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) / 100) + floor((substring-before(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-") + 4800 - (floor((14 - substring-before(substring-after(concat(string(substring(today(), 1, 4)), "-01-01T00:00:00"), "-"), "-")) / 12))) / 400) - 32045) + 1)
 
There seems to be quite a bit of confusion among the ranks as to what Julian is. Perhaps some of the confusion is my own lack of military background.  My first spoken requirements were to create a Julian Day of the year for a form field. So I looked on wikipedia and discovered that the Julian Day Number is the number of days since Day 0 which is marked at 1/1/4713 BC Greenwich Time. Today, Oct. 15, 2010 that number is 2455485. That was fairly easy.
 
However the client actually uses a day which is not based on the Julian Date way back in 4713. It is based on the first day of the current year. It's called an ordinal day. Sticking the last 2 digits of the year on to the front of that number gives you a Military Julian day. The XPath is ugly but it works..even for Leap Years!
 
The formula above finds the julian day for the first of the current year (1/1/2010) and the julian day for the current day and subtracts the current Julian from the First of the year julian. 1 is added to the difference to arrive at the julian day of the year. I then concat the last 2 digits of the current year to the front and that's it. I store it in the dataset and then concat a time stamp to the end to get the tracking number in a format that is useful and generates a unique number.
 
Code behind does all this in about 2 lines of c# but then you need an admin to publish your form. That means making the client wait for who knows how long before they can see your forms.

SQL server 2005 UDF for getting the Military Julian Time

Posted by KansasCoder / Category:

Here's a function that will return the military julian equivalent of any date passed to it. The default is to return the current day's.
 
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Description: Function to return Military Julian in the format of YYDDD
-- RETURNS:  varchar data type
-- INPUTS:  date or default
-- Example Using Today's Date: select dbo.fnGetMilitaryJulian(default)
-- Example Date: select dbo.fnGetMilitaryJulian('01/08/2008')
-- Example Leap Year: select dbo.fnGetMilitaryJulian('12/31/2012')
-- =============================================
ALTER FUNCTION [dbo].[fnGetMilitaryJulian]
(
 -- Add the parameters for the function here
 @theDate datetime = null
)
RETURNS varchar(5)
AS
BEGIN
 -- Declare the ordinal part of the variable
 DECLARE @miljul varchar(3)

--treat an empty string or spaces as a null
if rtrim(ltrim(@theDate)) = ''
 set @theDate = NULL
DECLARE @d varchar(2);
DECLARE @m varchar(2);
DECLARE @y int;
DECLARE @firstofyear datetime;
DECLARE @yearpart varchar(2);
DECLARE @tempjul varchar(5);
set @m = 01;
set @d = 01;
-- set year part on the date passed in
if @theDate is not null
  BEGIN
   set @y = year(@theDate);
 set @yearpart = RIGHT(convert(varchar(4),year(@theDate)),2);
  END
else
  BEGIN
 -- set year part for today
 set @y = year(getdate());
 set @yearpart = RIGHT(convert(varchar(4),year(getdate())),2);
  END
 -- finally determine the first day of the year requested
 select @firstofyear = convert(datetime,@m +'-'+ @d +'-'+ convert(varchar,@y))
 -- get the ordinal day from the constructed date
 if @theDate is not null
   BEGIN
     SELECT @miljul = convert(varchar(3),datediff(day,@firstofyear, @theDate) + 1)
   END
 else
   BEGIN
  -- set miljul for today
  SELECT @miljul = convert(varchar(3),datediff(day,@firstofyear, getdate()) + 1)
   END
 -- insure the ordinal day is 3 digits long
 set @miljul = right(replicate('0',3) + @miljul,3)
RETURN @yearpart + @miljul
END