Friday 26 December 2014

Set Sunday of current week to Date and time column in a list using Formula


If we want to set Sunday of current week for a  column in a list then follow the steps below

Add a date and time column to a list

Name it as Date

Select Calculated value radio button under Default value section

in textbox enter formula =1-WEEKDAY(TODAY)+TODAY
 

[datetimeset.GIF]


Sunday of this current week:
 
=1-WEEKDAY(TODAY)+TODAY 

Monday of this current week:
 
=2-WEEKDAY(TODAY)+TODAY 

Tuesday of this current week:
 
=3-WEEKDAY(TODAY)+TODAY 

Wednesday of this current week:
 
=4-WEEKDAY(TODAY)+TODAY 

Thursday of this current week:
 
=5-WEEKDAY(TODAY)+TODAY 

Friday of this current week:
 
=6-WEEKDAY(TODAY)+TODAY 

Saturday of this current week:
 
=7-WEEKDAY(TODAY())+TODAY() 

SUNDAY of following week, when Monday & not Sunday is used as day #1 of week:
 
=8-WEEKDAY(TODAY())+TODAY()

Also, if you change the format of the cell to a custom format and choose DDD it will display Fri or Mon and if you use DDDD it will display Friday or Monday, etc.




Reference:

http://superuser.com/questions/376698/how-to-get-the-dates-of-the-current-monday-wednesday-and-friday-of-the-current

http://sridharu.blogspot.in/2009/01/set-default-date-time-to-datetime-field.html


Set column in a list to Read only using Sharepoint Designer



Using SharePoint Designer, you can make one of the columns on your list/library Read-Only so that when a user goes to edit the list item, that one particular field will be unmodifyable, even for Full Control Permissions.
This can be done by changing the field type from an “editable” field to a simple “display” field.
To do this, open up SPD and navigate to your list.
You want to create a new “Edit” form for this list so click on the “New…” button:
new-edit-form
Type in a name for your new form. Select the “Edit Item Form” radio button and go ahead and make this the default form for editing.
read-only-columns
Click OK and then open up your new form to edit the code.
In this particular library, I have a column that I named “Read-Only” which I will be changing to read-only mode in the edit form. To do this, scroll down to the column inside the code and change the following:
 
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Edit" 
FieldName="Read_x002d_Only" __designer:bind="{ddwrt:DataBind('u',
concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(
string(@ID)),'@Read_x002d_Only')}"/>
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}" 
FieldName="Read_x002d_Only" ControlMode="Edit"/>

to
 
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Display"  
FieldName="Read_x002d_Only" __designer:bind="{ddwrt:DataBind('u', 
concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims( 
string(@ID)),'@Read_x002d_Only')}"/> 
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}"  
FieldName="Read_x002d_Only" ControlMode="Display"/>

Now when you go to edit an item on your form via “Edit Properties”, the column will be read-only.





Reference:

http://sharepoint.indigoreality.com/2013/04/03/sharepoint-2010-making-a-column-read-only/