Tag Info

Hot answers tagged

6

The main point here is that you can work with SharePoint Object Model from PS. So, your task is just to find out the way to change default field value using SharePoint Object Model, and translate it to PS notation. The default value for a column in SharePoint object model is set using SPField.DefaultValue property. So, let's try use this knowledge in PS. I ...


5

What a fun problem! For column LastMonday: =IF(WEEKDAY([Created])=1,DATE(YEAR([Created]),MONTH([Created]),DAY([Created])-6),DATE(YEAR([Created]),MONTH([Created]),DAY([Created])-WEEKDAY([Created])+2)) For column NextSunday: =IF(WEEKDAY([Created])=1,[Created],DATE(YEAR([Created]),MONTH([Created]),DAY([Created])-WEEKDAY([Created])+8)) You can do this as a ...


4

Try this formula as default value : =Today+1+(9/24) this should do the trick :) times are stored as fraction, so using this method you can also specify minute, say you want to set default value as 9:30 AM then you can write =Today+1+(9/24)+(30/(24*60))


3

You could edit the DispForm of the list item and in it have a delegatecontrol (or some other custom control) to count how many times the page has been loaded by unique user id's other than the authors id. Update Create a new user/web/delegate control and insert the following code: var web = SPContext.Current.Site.OpenWeb(); var list = web.Lists["Name of ...


2

The REPLACE function takes 4 parameters, so you would need to write it like this: =REPLACE([Me],FIND("DOMAIN\",[Me]),LEN("DOMAIN\"),"") EDIT: For the default value of a column, [Me] is fine. However, you cannot use [Me] in a calculated column, so this will not work either. And, from your description it sounds like you want the user that created the list ...


2

This is a good reference on calculated columns. I've found the easiest way (for me) to get user information is using SPServices and jQuery and setting the field value on item submission. With SPServices SPGetCurrentUser operation, you can get various properties when they're filling out the form and put that into the hidden title field right away.


1

I think you could do it either by using event receiver or by Default node inside Field node: <Field ID="{f4c96457-f8e8-4544-8165-a164123db510}" Name="testColumn" DisplayName="test Column" Type="Note" RichText="TRUE" RichTextMode="FullHtml" Required="FALSE" Group="Custom Site Columns"> ...


1

Try with the following code, SPFieldDateTime articleDate =(SPFieldDateTime ) currentWeb.Fields[FieldNames.ArticleStartDate]; Where, SPFieldDateTime - Represents a field that contains date and time values.


1

So the problem is that the Width and Height properties do not expect strings, but Unit as you have used in your code example. For XML: <property name="Width" type="unit">600px</property> <property name="Height" type="unit">600px</property> as you see, the only real difference is the type, that is unit and not string. Overriding ...


1

You can change your DateTime field's default value by: Navigate to your list Click Settings -> Document Library Settings Click your column's name, ex: "Date Modified" Set the "Default value" radio button to "Today's Date" I'd be interested in your actual requirements because, as @Dave Wise mentions, there are already columns called Created and Modified ...


1

Lena, Can you use Query string parameters to send the required default dates in URL ? If yes, You can have a look here, I have used Content Editor Web Part to take input the text parameters and send them as Query String and filter the XSLTListViewWebPart... You can skip the external list part...


1

You would need to create the site column, and the default value, then you need to touch all existing items in the content type to update them. The code to update items in powershell is here I sourced that for you, I'm not sure if you would have to set it or just update it, if you edit the content type and save it will add the default value, I am not sure ...


1

When rendering a mandatory lookup column SharePoint will render it as a HTML <select> with only the valid entries and no blank entry. It'll mark the current <option> with the attribute selected. If the current (default) value isn't in the list then no entry will be marked as selected. The browser will show the <select> as a dropdown with ...


1

The reason why only the last term is applied, is because you are overwriting the previous one with your code. To add multiple values the better approach is to first build the whole string with terms and update the integer (in your code 1033) on every term to want to add in the foreach loop (or make it a for loop to use the loop int value). Between the ...


1

There are a few options to auto-populate the metadata. Write server-side code: Using Visual Studio, create an ItemAdded event receiver. In there you can access values from the url as well as data stored in your site. Customize your form in SharePoint Designer: Use client-side code to populate your columns. Here ia a JavaScript library to help you and the ...


1

My opinion is to include the metadata. If the files need to be found later, utilizing metadata makes it a no brainer. You can use views and search scopes to find information easily. If you don't, you're hamstringing yourself. You could use some client side scripting on the EditForm of the document library, this is where you get redirected to after you've ...



Only top voted, non community-wiki answers of a minimum length are eligible