IT Heroes Posted October 4, 2010 Posted October 4, 2010 Hi, I'm getting an index out of bounds exception from the fmpro object when executing a query. It seems a particular record is causing the problem, because it doesn't happen when I change the parameter in the WHERE clause. The exception originates from FMPro.java:179 java.lang.ArrayIndexOutOfBoundsException: 3 Parameters: {sql=SELECT "Record No", "Category", "Message details", "Date" FROM "Job Tracking 2" WHERE "Job Number" = '0000511'} ---Script--- Script: String[][] data = fmpro.executeSqlArray( sql ); return ""; Thanks, Ryan
dansmith65 Posted June 30, 2011 Posted June 30, 2011 I just experienced this issue as well, and think I have discovered the problem and uncovered another related issue with executeSqlArray()... This is the simplest code that demonstrates the issue, it should be run from the ScriptMaster.fp7 file. fmpro.executeSqlArray( 'SELECT "Is GUI function", title FROM Demo' ) By default, it should work (or look like it worked, at first glance). If you look closer at the result, you will notice that when "Is GUI function" field is empty, it's value (null) is after the title. This is the other related issue I was talking about. Next, go to the first function in the list of found functions (it should be "Basics Example of Variables and Results", it was for me), then un-check the GUI function field, then go back and run the code above again. This time you will get the ArrayIndexOutOfBoundsException. I think the issue comes from not testing for a null value (or FileMaker returning a null value in a manner that cannot be tested for). Either way, this one has to be fixed by 360Works since it is in the ScriptMaster plug-in itself.
dansmith65 Posted July 14, 2011 Posted July 14, 2011 Has anyone from 360Works been able to confirm this issue?
epeeler Posted October 10, 2011 Posted October 10, 2011 Have you tried updating to the newest version of ScriptMaster? I know there have been some changes since this thread was started.
dansmith65 Posted October 12, 2011 Posted October 12, 2011 It's been a while, but I believe my post on June 29 was done in the current version (4.124). Have you tried to re-produce this, as outlined in that same post?
John A Posted October 25, 2011 Posted October 25, 2011 See related thread: http://fmforums.com/forum/topic/80863-fmproexecutesqlarray-problems-with-result-count-and-field-names/ No solution there.
wbasham Posted November 1, 2011 Posted November 1, 2011 Can you send a sample file with the issue? We are going to try to get this issue resolved soon. Brent Basham [email protected]
John A Posted November 1, 2011 Posted November 1, 2011 I'll create an example this evening and send it on. Tx Brent! John-
dansmith65 Posted November 3, 2011 Posted November 3, 2011 See my first post in this thread for how to re-produce this issue in the ScriptMaster sample file.
John A Posted November 4, 2011 Posted November 4, 2011 Thanks Dan. I have not had time to create my test file. I also want to know why it acts differently in different contexts http://fmforums.com/...nd-field-names/ Right now I am having to pepper my code with if statements that count result sets, its a real pain.
wbasham Posted November 7, 2011 Posted November 7, 2011 I wanted to let everyone know we are aware of this issue and are looking into it. I also want to apologize for the delay in handling this. My email is [email protected] and I will be working on a solution. When resolution is reached I will post here for everyone to review. Again, I am sorry for the delay.
Smef Posted November 11, 2011 Posted November 11, 2011 We've resolved this issue internally. This will be fixed in our next release of scriptmaster. I'll try to get a beta build for you guys if I can so that you can try it out before we release it.
john renfrew Posted November 12, 2011 Posted November 12, 2011 Thanks David - can you confirm that you will update to the latest Groovy too at the same time?? http://fmforums.com/forum/topic/79058-update-to-groovy-18/
Smef Posted November 17, 2011 Posted November 17, 2011 Try this beta and let me know how this works for you.
dansmith65 Posted November 18, 2011 Posted November 18, 2011 It seems to be working now. Thanks for the fix!
john renfrew Posted December 14, 2011 Posted December 14, 2011 Bump Any chance of a Groovy update? Been asking since the summer now... Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now