Monday, November 19, 2012

Infopath 2010 - Select a Photo from Picture Library

1. Copy the picture library by going to Picture Library Settings – Save Site as template (and include content) – optional. You can use the existing if you wish.
2. Take note of the photo URL of any picture – you will need this later.



3. Create a new Custom list. Just add one field, Employees as Person or Group. Make this field compulsory. You will add in the rest of the fields from Infopath later.4. Edit the form in Infopath 2010.

Sunday, November 18, 2012

Infopath 2010 Only create new list item within a given date range

Create a Sharepoint 2010 list and add some fields.
Open the list in Infopath 2010 for editing.

Add a new variable, e.g. Today.
Add a new Form Load rule and assign the variable to the current date and time. This will be used for checking the date later.



Sharepoint 2010 - Get Work Week

Sharepoint 2010 - Get Work Week

Excellent post on getting the Work Week or Week of Year from http://joranmarkx.wordpress.com/2011/12/09/use-the-calculated-field-to-show-weeknumber-in-sharepoint-2010/

For my own notes only, no plagiarism intended.

Work Week calculation:

If the work week starts from the Monday of the week that contains the first Thursday of the year:
=INT(([datecolumn]-DATE(YEAR([datecolumn]-WEEKDAY([datecolumn]-1)+4),1,3)+WEEKDAY(DATE(YEAR([datecolumn]-WEEKDAY(datecolumn-1)+4),1,3))+5)/7)

If the work week starts from the Monday of the week that contains the first Monday of the year:
=INT(([datecolumn]-DATE(YEAR([datecolumn]-WEEKDAY([datecolumn]-1)+4),1,3)+WEEKDAY(DATE(YEAR([datecolumn]-WEEKDAY(datecolumn-1)+4),1,3))+1)/7)

-Calculate the distance between the beginning of the year (with regard of the start of week 1) to the datecolumn
-Add the day of the week of the 1st January of the datecolumn year added with 5 (Thursday)
-Divide by number of days in a week
-Floor by doing a cast to INT

If week 1 starts in the week of the 1st January (USA Standards):
=INT(([datecolumn]-DATE(YEAR([datecolumn]),1,1)+(TEXT(WEEKDAY(DATE(YEAR([datecolumn]),1,1)),"d")))/7)+1

-Calculate the distance between the beginning of the year to the datecolumn
-Add day of the week of the 1st January of the datecolumn year
-Add divide by number of days in a week
-Cast to integer (is Floor)
-Add one day

Related Posts Plugin for WordPress, Blogger...