Set the current date time (can also be done just by using SharePoint default column value available in column’s configuration)
= new Date(2014, 5, 3)
Set the date to 3rd June 2014. Note: The month (2nd) parameter is 0-based, so January is 0 and December is 11.
= new Date().addDays(10)
Set the date to current date (and time) plus 10 days. Use addDays(-n) to subtract n days.
= new Date().addHours(4)
Set the date to 2 hours in future.
= new Date().addYears(-1)
Set the date a year ago from today.
Calculating date time fields
=[[SomeOtherDate]]
Get the date time field of another date time field. Note: Use value expression when setting fields using calculated expressions.
=[[SomeOtherDate]].addDays(10)
Get the date time field of the SomeOtherDate column plus 10 days.
{
if ([[ContractType]]==“Monthly”)
return [[StartDate]].addMonths(1);
else if ([[ContractType]]==“Quarterly”)
return [[StartDate]].addMonths(3);
else if ([[ContractType]]==“Semi-Annually”)
return [[StartDate]].addMonths(6);
else if ([[ContractType]]==“Annually”)
return [[StartDate]].addYears(1);
else return null;
}
Get a date depending on value of field ContractType and StartDate. When ContractType is “Monthly” the date is calculated as StartDate plus 1 month, when ContractType is “Quarterly” the date is calculated as StartDate plus 3 months, etc. If ContractType does not match any of the checked values no date is returned.As an example this function expression could be used as a calculated expression to set the RenewalDate field of a contract item.
Retrieving information for current user
Retrieving information for the user selected for a field
[[SomeUserField.Email]]
Gets the email address of the user selected for the field SomeUserField.
[[SomeUserField.LoginName]]
Gets the login name of the user selected for the field SomeUserField.
Post your comment on this topic.