Page 1 of 1

Save form automatically after 10 seconds

Posted: 17 Sep 2018
by ibarrandres
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.

Re: Save form automatically after 10 seconds

Posted: 18 Sep 2018
by AlexZver
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.

Re: Save form automatically after 10 seconds

Posted: 19 Sep 2018
by ibarrandres
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.

Re: Save form automatically after 10 seconds

Posted: 20 Sep 2018
by AlexZver
Yeah, you absolutely right, the fields should be enabled before saving the form.
Actually really glad to hear that you've found a solution.