Save form automatically after 10 seconds

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
ibarrandres
Posts: 23
Joined: Wed May 27, 2015

17 Sep 2018

Hello,

I have a problem where a lot of records need to be re-saved so that the calculation that I am doing on the form level re-calculates. I attempted to execute the save button via code but the data does not save to the list. The data does save if I click the button manually though.

I am doing some % calculations when the page loads and I would like to have the form save after 10 seconds.

I read some articles on maybe how to do this but I haven't been successful.

I've tried triggering the save button by Jquery by: $("savebutton").click();

and using the form designer JS framework: fd.save().click();

setTimeout(function() {
//examples above
}, 10000);

these examples do trigger the button to save and the page acts as if its "saving", and it redirects back to the list but the calculation fields don't save. They do save if I manually click the save button my self though, so I am not sure what I'm missing from the save functions.

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

18 Sep 2018

Hi,

Looks like the error is in the calculation logic, not in clicking the save button. fd.save().click() triggers the same actions as clicking the button manually.
Please provide your form (by the ribbon button 'Export') to find out where can be a problem.

ibarrandres
Posts: 23
Joined: Wed May 27, 2015

19 Sep 2018

I figured out what was the problem.. Apparently if you manipulate any fields by using Jquery with .prop() to disable the fields those fields wont be saved. You have to .prop() enable the fields before saving.

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

20 Sep 2018

Yeah, you absolutely right, the fields should be enabled before saving the form.
Actually really glad to hear that you've found a solution.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 29 guests