Limit exceeded

S

Sam

The number of calculations used for a single action exceeded the maximum limit.

This is the error that I'm receiving. I can't find a way to get rid of this
one. There is pretty much calculations in the form and I need them all. In
some thread there was a suggestion to make code to prevent this. However I'm
pretty new in coding with Infopath. Any help for coding this thing would be
appreciated?
 
G

Greg Belenky

This is the error that I'm receiving. I can't find a way to get rid of

Infopath has data-oriented events. So if you change data when infopath
executing code for it -he event will be fired again... and again... and you
have the error.

in my forms if i need to change data in event handler - i add boolean flag,
and in first line of handler - check it.
if it's true - just return. else set it true, make whatever you want, set
flag to false.
 
S

Sam

I don't entirely understand what do mean Greg, with these boolean-flags.
Example code could help.
 
G

Greg Belenky

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

handler = 0;
}
 
S

Sam

I'm confused. I have pretty much calculations so I can't know which one of
them is causing the problem. So before I did any coding I ran a test and
tried to delete every calculations one by one. At the moment in the form
there is absolutely no calculations or rules of any kind left. Still I
receive this error message "The number of calculations used for single action
exceeded the maximum limit". Any wise suggestions how to preceed from this
one? I myself feel like being in the dead-end.
 
S

Sam

Oh, now I realised what's going on. We are talking slithly different thing
with Greg. I receive the same error, but my error occures when I make query
to database with following line:

XDocument.Query();

So the calculation limit is not exceeded, but some kind of query limit.
Is there some limits in number of tables when making query from Access
database? I have 12 tables in database and everyone of them has at least 20
fields. How can this problem be solved?




Greg Collins said:
Have you tried using the debugger to step through your code to find out what's going on?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



I'm confused. I have pretty much calculations so I can't know which one of
them is causing the problem. So before I did any coding I ran a test and
tried to delete every calculations one by one. At the moment in the form
there is absolutely no calculations or rules of any kind left. Still I
receive this error message "The number of calculations used for single action
exceeded the maximum limit". Any wise suggestions how to preceed from this
one? I myself feel like being in the dead-end.

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

handler = 0;
}
 
B

Brian Teutsch [MSFT]

The query limit is designed to let the user know that displaying the view
may take a long time. It can be avoided by returning less data as part of
your query. I don't know the specific limits, but they're decently high. The
risk is that if you try to show too much data in your view, the user will
think the application is broken or "hung" and will try to quit it.

Brian

Sam said:
Oh, now I realised what's going on. We are talking slithly different thing
with Greg. I receive the same error, but my error occures when I make
query
to database with following line:

XDocument.Query();

So the calculation limit is not exceeded, but some kind of query limit.
Is there some limits in number of tables when making query from Access
database? I have 12 tables in database and everyone of them has at least
20
fields. How can this problem be solved?




Greg Collins said:
Have you tried using the debugger to step through your code to find out
what's going on?

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



I'm confused. I have pretty much calculations so I can't know which one
of
them is causing the problem. So before I did any coding I ran a test and
tried to delete every calculations one by one. At the moment in the form
there is absolutely no calculations or rules of any kind left. Still I
receive this error message "The number of calculations used for single
action
exceeded the maximum limit". Any wise suggestions how to preceed from
this
one? I myself feel like being in the dead-end.

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

handler = 0;
}
 

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