bburke

Date Stamp a Repeating Control

Blog Post created by bburke on Aug 23, 2016

I had a lot of difficulty placing a date stamp on a repeating section entry.

aditya gandhe presented a solution Repeating Conrol + Current user Name + Time that included Current User and Time but it was more than I needed.

 

With some help from my colleagues on our development team, I'll document how we date stamped multiple repeating section entries.

 

First, on our form we placed a repeating section, inside that control we place a date/time control.

 

https://community.nintex.com/servlet/JiveServlet/downloadImage/190226/pastedImage_0.png

 

In the properties of the date/time control we set the Default Value to "blank" and Date Only to "Yes".

 

https://community.nintex.com/servlet/JiveServlet/downloadImage/190227/pastedImage_1.png

 

In the properties of the Multiline Textbox nested in the Repeating Section  create a control named "control-class" (of course you can name it what you want).

Ensure you connect the repeating section to a list column.

 

https://community.nintex.com/servlet/JiveServlet/downloadImage/190228/pastedImage_2.png

 

In the form settings, insert the following in the Custom JavaScript section:

 

NWF$(document).ready(function(){ 

NWF$(".control-class").on('change', function(e) {

var timestamp = new Date();

NWF$(this).closest('.nf-repeater-row').find('.nf-date-picker').val(timestamp.format('MM/dd/yyyy'));

});

});

 

https://community.nintex.com/servlet/JiveServlet/downloadImage/190229/pastedImage_5.png

 

Publish your form. If you enter text in the repeating section multiline textbox, the date/time control will not update until the focus changes to somewhere outside the multiline textbox.

 

This includes: If the user enters text in the multiline textbox, leaves the focus there and selects "Save", the focus will change and the date stamp will be saved to the form.

 

Additionally, if the multiline textbox is modified, it will update the date/time control.

 

Hopefully this will be useful to you somewhere down the line.

Outcomes