Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Use of app.setInterval

Avatar

Level 1

I have a simple save function (autoSav()) in a script object (Skip). The function operates as it should when used from say, the mouse-up event on a button.; it is a trusted function to save the form back on itself.

function autoSav()

{

  var myDoc = event.target;

SavInsp(this, myDoc.path);

}

However, when trying to get the following to work: var timeout = app.setInterval("xfa.form.form1.Insp_Report.Skip.autoSav()", 10000); I get errors indicating Skip is not defined or the function is not defined. I have tried multiple syntax changes w/o a cure.

Any direction would be greatly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Your code looks ok.  I normally put my script objects at the top level so it would be;

var timeout = app.setInterval("xfa.form.form1.Skip.autoSav()", 10000);

Try this code and see where it's starts going wrong;

var timeout = app.setTimeOut("app.alert(xfa.form.form1.somExpression)", 1000);

var timeout = app.setTimeOut("app.alert(xfa.form.form1.Insp_Report.somExpression)", 1000);

var timeout = app.setTimeOut("app.alert(xfa.form.form1.Insp_Report.Skip.somExpression)", 1000);

Regards

Bruce

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

Your code looks ok.  I normally put my script objects at the top level so it would be;

var timeout = app.setInterval("xfa.form.form1.Skip.autoSav()", 10000);

Try this code and see where it's starts going wrong;

var timeout = app.setTimeOut("app.alert(xfa.form.form1.somExpression)", 1000);

var timeout = app.setTimeOut("app.alert(xfa.form.form1.Insp_Report.somExpression)", 1000);

var timeout = app.setTimeOut("app.alert(xfa.form.form1.Insp_Report.Skip.somExpression)", 1000);

Regards

Bruce

Avatar

Level 1

Bruce,

Thank you for the insight. I will give it a try.

Skip