Clicking button set date of today and close the form

Hello everyone,

Nice to meet you all, and thanks for your reading. I'm a noob and a little bit annoying with a development.

On my form linked to a Sharepoint list, I want to :

  • click on a button (done it)
  • the click to update by retrieving the current date
  • close the form (in order to return to the Sharepoint list in question)

In my first approach, I posted this in GENERAL -> Property: click :

fd.field('xxxxDate').value = new Date();
return fd.close();

But this simply closes, without placing the date in the expected column.
In my js editor I only have a code to hide the toolbar and another to export to pdf before saving.

So, I'm asking what am I missing here ?

If anyone, do have an idea.
Thank you again,

You should only need the following:

fd.field('xxxxDate').value = new Date();
fd.save();
2 Likes

Hello cwalter2 ! thanks it works now also I've deselected "read only" property on this xxxxDate fields :slight_smile:

thanks again,

Hello @lolopixxx ,

the reason is that you closed the form and the value inserted in the field had not been saved :slight_smile:
Stepan

1 Like