Order records in a maintenance form


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I have a curious situation. I have a table for families, the BO has this method:

Public Sub FillAllRecords()

Me.FillDataTable("SELECT * FROM Familias ORDER BY Apellidos")

End Sub

I add three records, one begin with H, second with D and las one with A. Every time I load the maintenance form, goes to the second record in this case the one beginning with D, the order is correct, the first record is the one with A but I can not understand why goes to the second one.

Regards

Smile Everything is possible, just keep trying...

Replies
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi Trent

Sorry but I dont' have any sort or filter in the form. As I show before the SELECT statement has a ORDER BY and yes the order is respected when the form loads, the only thing is that the record that shows when the form is opened is the second one and the first one.

I review the forums yes but at least the ones I tale a look was on how to use a SORT or how to after save show the records sorted again.

I will review again, maybe as you said is the CurrentIndex... that goes to the second record and I don't know why?

regards

Smile Everything is possible, just keep trying...

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
I promise that this is your problem.  If you put a break point you will see that the data behind the CurrentRowIndex is changed....the ONLY way that this will happen is through a filter or a sort or manually changing the data table and/or view.  You are welcome to post a sample, but I have seen this too many times in the past and I am confident that is your issue.
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi



Just found the solution:



Private Sub FamiliasBO1_ParentFormLoading() Handles FamiliasBO1.ParentFormLoading

'-- Load BO

Me.FamiliasBO1.FillTodos()



'-- Go to first record

FamiliasBO1.Navigate(MicroFour.StrataFrame.Business.BusinessNavigationDirection.First)

End Sub



As the FillTodos is already sorted, I only need to go to the first record. Without that the BO loads ordered but shows the first record in the primary index. Navigate to the first record puts the form just as I need.



Thanks all for your help.

Smile Everything is possible, just keep trying...
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Juan Carlos,

Try putting the Navigate() command in the BO.FillTodos(), that way you keep the code related to the BO in the BO in case you need to call BO.FillTodos() from another place and want to have the records properly sorted.

Edhy Rijo

Randy Jean
Randy Jean
StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)
Group: StrataFrame Users
Posts: 105, Visits: 641
This is a re-producible issue that I showed Ben on the last day of training in Amarillo using sample app business objects and he confirmed it definitely was not a filter/sort issue with what I showed him, but immediately after the filldatatable, the currentrowindex was set to the 2nd record (or actually a 1 vs. a 0). Sure, putting a navigate in the fill method should rectify the issue, but still curious as to what's actually causing this to happen. I had been meaning to follow-up with Ben but been real busy with some other projects and just getting back to some Strataframe work myself. This has bitten us a few times but we've managed to just work around it for now.
Randy Jean
Randy Jean
StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)
Group: StrataFrame Users
Posts: 105, Visits: 641
Actually, a movefirst is what we want instead of navigate, I believe. Navigate tries to update bound controls so don't think that's needed if doing this inside the fill itself.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Juan Carlos Pazos - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Juan Carlos Pazos - 18 Years Ago
Trent L. Taylor - 18 Years Ago
                     Hi

Just found the solution:

Private Sub...
Juan Carlos Pazos - 18 Years Ago
                         Hi Juan Carlos, Try putting the Navigate() command in the...
Edhy Rijo - 18 Years Ago
                             This is a re-producible issue that I showed Ben on the last day of...
Randy Jean - 18 Years Ago
                                 Actually, a movefirst is what we want instead of navigate, I believe....
Randy Jean - 18 Years Ago
Alex Luyando - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Dustin Taylor - 18 Years Ago
Randy Jean - 18 Years Ago
Greg McGuffey - 18 Years Ago
                     In BusinessLayer.Events.VB

[codesnippet]
'''...
Randy Jean - 18 Years Ago
                         GladI found this post, I have been trying to figure out why a weekly...
Paul Chase - 18 Years Ago
                             Ok now that I know what is happening I really urgentlyhave to fix it...
Paul Chase - 18 Years Ago
                                 Any ideas?
Paul Chase - 18 Years Ago
                                     Is there a difference between the source posted in the user accounts...
Paul Chase - 18 Years Ago
                                         Well asI thought that was to good to be true :) I guessI must...
Paul Chase - 18 Years Ago
                                             Fixed...creating a new build as we speak and will post it within the...
Trent L. Taylor - 18 Years Ago
                                                 Here is the fix: http://forum.strataframe.net/FindPost18786.aspx
Trent L. Taylor - 18 Years Ago
                                                     Thank'sa bunch Trent
Paul Chase - 18 Years Ago
                                                         Sure :) Sorry for the trouble!
Trent L. Taylor - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search