Skip to main content

Summarization function internal error - Parameters

I have created a very simple piece of code that does a few analysis between 2 files. The problem is that it works correctly only for the first run when the analysis on both files are executed very first time. When I run that code again on the initial 2 databases I used in first place the code generates the error - "Error on line 259" which is task.PerfromTask while summarization function is executed - as the error is quite ambigious I am not sure how to resolve it. Additionally the IDea gets closed immediately after this error. I suppose somehow the parameters in 2 arrays that i use throughout: UserChoice(0-3) and UserChoicePayroll(0-3) are not recognized within task AddFieldToSummarize...
The code uses the parameters indicated by the user via 2 dialog boxes as follows:
Where top 4 parameter belong to array UserChoicePayrol(0-3) and bottom 4 belong to UserChoice(0-3).
 

Brian Element Wed, 07/10/2019 - 08:48

Hi bluecox,

I have been playing this for the last 90 minutes and unfortunately I don't have any more time to try and figure this out.  I have figured out that the problem is with the indexes getting corrupted, that is why it works the first time but not the second time.  

The problem seems to start in the UniqueEmployeeNames function but I can't figure out why.  If this was my project I would start putting it together one step at a time and making sure it works, there is probably something small that is causing this but I can't see it and unfortunately it is difficult to find these types of problems when the script is complete.  I also notice that you define multiple variables on the same line, IDEAScript has a bug that it doesn't handle this problerly so you should only define one variable per line, this might be the cause of the problem.  It is also better to use the option explicit and make sure all your variables are properly defined, this could also be a source of the problem.

Good luck with the project.

Brian

bluecox Wed, 07/10/2019 - 11:04

Hi Brian,
Many thanks for looking into my problem - really appreciate it.
To think of it when i was developing the code it was working correctly all the time until the time when i added ModifyField function that changes the field name within one of the database in Test 5.
I will try to remove this and see if it does make any impact.
 
Thanks again.
Regards
Paul

Brian Element Wed, 07/10/2019 - 11:27

In reply to by bluecox

Actually that could be a problem as you are renaming a field that an index is based on but then rerunning it, so IDEA is getting confused with the index as the name has changed.  Sounds like a good place to start.