How do you know what record your on in a BO


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Terry,

I am glad this worked for you.

Happy holidays to you too!

Edhy Rijo

Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
       Dim myCurrentRowIndex As Integer = Me.BizServiceCalls1.CurrentRowIndex
        '-- here do whatever you want with this BO and move the position as you like.
        '-- Now go back to the old record
        Me.BizServiceCalls1.MoveAbsolute(myCurrentRowIndex)
I did the above but in just TESTING the Dim statement I kept getting 0 for the value of myCurrentRowIndex. I thought that can not be because I am not on record 1. Well as I spent more time on my code I really was on record 1 and not where I wanted to be. So Edhy, you helped me again and I found one of my logic errors. A great christmas gift. Thank you so much.
But the following I did not know about so this will be very helpful down the road. 
        '  Also keep in mind that if you need to loop the BO you can take advantage of the
        '  BO.GetEnumerable() method that will allow you to loop and keep the CurrentRowIndex
        '  unchanged after finishing the lopping.  Here is an example:
        For Each boRecord As bizServiceCalls In Me.BizServiceCalls1.GetEnumerable()
            '-- Now you are looping each record in the BO instance Me.BizServiceCalls1
            boRecord.Apt_No = "3-D"
            boRecord.Notes = "This is a note sample"
        Next
        '-- Now if you try to use the bo instance Me.BizServiceCalls1 it will be in the same
        '   CurrentRowIndex as before you started the GetEnumerable() loop.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Terry,

The CurrentRowIndex will give you the index of the current row in that BO.  Here is a sample on how you can do some things, look at the comments.  In my sample the BO dropped in the form is Me.BizServiceCall1 and it is based on the bizServiceCall.vb class:

        Dim myCurrentRowIndex As Integer = Me.BizServiceCalls1.CurrentRowIndex
        '-- here do whatever you want with this BO and move the position as you like.

        '-- Now go back to the old record
        Me.BizServiceCalls1.MoveAbsolute(myCurrentRowIndex)
        '  Also keep in mind that if you need to loop the BO you can take advantage of the
        '  BO.GetEnumerable() method that will allow you to loop and keep the CurrentRowIndex
        '  unchanged after finishing the lopping.  Here is an example:
        For Each boRecord As bizServiceCalls In Me.BizServiceCalls1.GetEnumerable()
            '-- Now you are looping each record in the BO instance Me.BizServiceCalls1
            boRecord.Apt_No = "3-D"
            boRecord.Notes = "This is a note sample"
        Next
        '-- Now if you try to use the bo instance Me.BizServiceCalls1 it will be in the same
        '   CurrentRowIndex as before you started the GetEnumerable() loop.


Take a look at the SF help for more detail and sample on how to navigate the business object.  Since Trent introduced the bo.GetEnumerable() method, I became a big fan of it.

Edhy Rijo

Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Lets assume that my BO has 10 records in it and for what ever reason I move thru the first 2 records and now I am on record three.
Now I want to store where I am in the BO so that I can return to record 3 if I have to. How do I store a pointer to record 3 so I can return if I have to. I thought I wanted to use MoveAbsolute to return to this record but I don't know it's position unless I set up a counter?
I thought I might be able to use currentrow or currentrowindex but I can not seem to find the correct syntax if I can use these. Is there a simple way to do this or do I need to use a counter?

TIA.
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