Tag Info

Hot answers tagged

7

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

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 ...


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

Instead of only Today+1 use =Today+1+(9/24)


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.


2

You'll need to set the EmptyMessage web part property value. The property is hidden so you'll have to set it programmatically or by exporting the web part and editing the .webpart file.


1

There is property called DefaultValue. $FieldName = $list.Fields["NH Department"] Write-Output $("NH Department - Default Value " + $FieldName.DefaultValue)


1

This will give you the format 2013-2014, 2014-2015: =IF(MONTH(Created)>6,YEAR(Created)&"-"&YEAR(Created)+1,YEAR(Created)-1&"-"&YEAR(Created)) It takes MONTH>6, so you could adjust that parameter for fiscal start. And for FY 2014, FY 2015 etc, you could use this formula: =IF(MONTH(Created)>6,"FY "&YEAR(Created)+1,"FY ...


1

Strictly speaking it is not possible to set a default value on a people field. But, you might be able to accomplish your requirement another way. For example, A workflow A list item event receiver Some JavaScript on the new item form that prepopulates the form field. ...And, there is a third party tool that claims to do what you're looking for. As is ...


1

Well every other method still didn't work. SharePoint just wipes the text when the form loads. So I created a button which adds the default text when user clicks it. var templateText = "teeeeeext"; $(".ms-rtestate-write").parent().parent().append("<input id=\"templateLink\" type=\"button\" value=\"Incident Template\">"); ...


1

try this $('nobr:contains("your multiple line text field name")').closest('tr').find('div.ms-rtestate-write').text();


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

Yes, I have used a URL parameter to do this in the past. So you need to add a button or something to your page which calls your form but with the parameter you need eg /NewForm.aspx?choice=Test1 You can then used JavaScript or jQuery in the form to get the parameter and set the default of the choice field. There is an example here here though you may need ...


1

If you want something to change conditionally within an InfoPath form, you will need to use either rules or code. How else should InfoPath know what to do? So, set the default values, then when the checkbox field is changed, run a rule to change the radio button value.


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

We do this by storing the id's in the SPSite.RootWeb's PropertyBag (SPWeb.SetProperty) on site creation. If needed, you can auto fill any metadata associated with content added to the site by accessing these values in an ItemEventReceiver.


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