Empty table and BO CurrentRowIndex exception


Author
Message
Doug Birtell
Doug Birtell
StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)StrataFrame Beginner (33 reputation)
Group: Forum Members
Posts: 33, Visits: 64
All, (anybody)

When I run a SF maintenance form that uses a BO that references an empty table, I get the following exception.

The CurrentRow could not be evaluated because the CurrentRowIndex is out of range.  Business object record count: 0.  CurrentRowIndex: -1.

If I manually add a row to the table, then the app works fine.  Is there some way to check the CurrentRowIndex within the BO to keep the application from choking?  The table that this SF form maintains will always be empty to start with.

Thanks!

Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You got it.  Smile  The only time this error will occur is when a strong-type field property, custom or otherwise, is referenced and there are no records visible within the CurrentView (no records, filtered out, etc).  So as you discovered, if you test on the Count you will be able to safely reference the field properties.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search