Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

executeSql ArrayIndexOutOfBoundsException

Featured Replies

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

  • 8 months later...

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.

  • 2 weeks later...

Has anyone from 360Works been able to confirm this issue?

  • 2 months later...

bump

Have you tried updating to the newest version of ScriptMaster? I know there have been some changes since this thread was started.

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?

  • 2 weeks later...

I am experiencing this as well.

See related thread: http://fmforums.com/forum/topic/80863-fmproexecutesqlarray-problems-with-result-count-and-field-names/

No solution there.

Can you send a sample file with the issue? We are going to try to get this issue resolved soon.

Brent Basham

[email protected]

I'll create an example this evening and send it on.

Tx Brent!

John-

See my first post in this thread for how to re-produce this issue in the ScriptMaster sample file.

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.

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.

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.

Hooray! Thanks David.

Try this beta and let me know how this works for you.

It seems to be working now. Thanks for the fix!

  • 4 weeks later...

Bump

Any chance of a Groovy update?

Been asking since the summer now...

Thanks

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.