0

I'm fairly new to SharePoint and I'm still learning the terminology so please excuse

I have 2 Date Time columns in a SharePoint list, Date Received and Due Date. The Due Date is supposed to be 30 days from the Date Received date. If I make the Due Date a Calculated Column, it's fairly straightforward.

=[Date Received] + 30

However, calculated columns can't be modified by users. In this case, I need to allow users to change the Due Date column which isn't and make the default value for the Due Date using the Calculated Value option. My issue is that an error occurs when I try to use the same formula in the Calculated Value input box. Is it not possible to reference other columns in a formula to calculate the default value of a Date column?

1

A default value formula cannot reference another column because the list form does not support a dynamic recalculation of the default formula.

If you need to set a default value based on another column, and still have that user editable, you can use InfoPath to customise the form, or if you don't have that, use Javascript / jQuery to set the field.

0

You can use a workflow to handle this. The workflow should start on item update.

Use an if condition to check

if currentitem:DateReceived equals empty
     Update currentitem:DueDate = currentitem:DateReceived + 30

I used following to get this working in both New and Edit use cases

enter image description here

Variable: date - This should be string type and CurrentItem:DueDate should return ShortDate

Variable: date1 - This should be date time type.

Update - This should set current item DueDate with value in variable: date1

  • 1
    that does not help while the user is editing the form, though. – teylyn Nov 19 '14 at 19:29
  • @teylyn how this approach will not work in edit cases? I have updated my answer with the workflow steps – Amal Hashim Nov 19 '14 at 19:55
  • 1
    the workflow will only kick in after the item is saved. Then the user can open it again and see the calculated value. As I understand the question, dspencer wants the field to be showing the calculated default value dynamically, while the form is being edited. So, user loads a new form. DueDate is blank. User edits DateReceived and now DueDate immediately shows the calculated value, which the user can edit. Then the user saves. Workflows can't do that. Javascript or InfoPath can. – teylyn Nov 20 '14 at 1:18
  • @teylyn Yes, that is the correct behaviour I would like to achieve. Amal's solution does work as it does add 30 days to the Due Date field but as you mentioned, it's not the optimal user experience as the user would technically have to save the item and then view the item to see the Due Date column value. – dspencer Nov 21 '14 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.