Still problems with limits

S

Sam

The matter is same: too many calculation because of loop. Sometimes the error
message is displayed but sometimes the calculation fields are just zero
without warning. I received advice to do boolean flag as follows

var handler = 0;
function ...::OnAfterChange(eventObj)
{
if(eventObj.IsUndoRedo || handler > 0) return;
handler = 1;
.....

handler = 0;
}

I just can't get it work or I can't use it properly. Programming skill is
not so good. Big amount of calculation should be launched when opening the
form and excuting a query from database(XDocument.Query();). Also
calculations should be made when certain check box is checked. I have
problems in both cases. At least one of those cases is not working when
executing. What can be done?

Sorry if I have asked similar questions, but I just want to make this work
properly.
 
F

Franck Dauché

Looks like these events are asynchroneous in InfoPath. So OnAfterChange is
triggered by one node, and while your flag is set to 1, another node
triggers it too...then the code that was supposed to run for that node is
not running.....Your flag needs to be a little more sophisticated if you
want the proper code to be run.

Franck
 
S

Sam

Your flag needs to be a little more sophisticated if you
want the proper code to be run.

Yes, I realize that but the problem is that I don't know where to start when
building a working code for the flag. I'm not so good in programming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top