I've been asked to add a date/time stamp to each new entry in a repeating section.
If the user enters a comment and then selects "Add new row" or the form is saved, a date/time stamp is added to the comment.
Is this Possible? -bill
Every SharePoint list has the capability to create a comments field that appends to the list each time an item is edited. It is achieved via the Multi-line text column and versioning.
To set this up open up your List Settings and turn on versioning in your list.
Create a multi-line column (Comments) in your list and select the setting that says "Append Changes to Existing text".
Now, whenever your user adds a comment, it is appended to existing comments with the users name and a date/time stamp.
Like I stated at first, this may not be the user experience you wanted, but it may get you close and doesn't require custom code.
If the user enters a comment and then selects "Add new row"
you can fullfil this requirement by writting your own trigger for Repeater Row Added event. within the trigger you can check whether a comment field has been entered and if so then set value for a date field
or the form is saved
catching 'save' event might be a bit problematic.
I would two easier ways how to achieve similar outcome with less effort:
1. configure default value to current time for date control
it's not really 'save time' but might be close enough to meet your needs
I was able to capture the date the comment was entered by adding a date control to the repeating section.
I set the date control default to "today".
I then created two rules on the date control:
I have tested this and each date is captured and retained when the date control is disabled.
No need to create a list column for the date control or associate it to anything. The date is captured in the repeating control xml.
Not exactly what I was looking for (I didn't want to see the control, wanted to use a calculated value so I can control the text visually) but this prevents me from having to insert any custom code.