Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
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

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