BO-Movenext and Edit


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

I am looping through a file:



BestBo1.moveNext()

   If BestBo1.Formatiert    ' Logical Field

      Me.doldsabfrage(oLDS)   ' Do an online-query

   Endif

Loop while BestBO1.movenext



in the follwong sub "doldsabfrage" something strange happens. If the online-rrequest ist succesful,

I do this:



lRet = olds.dorequest()

if lRet

   BestBO!.Edit()

... Assign some fileds

   BestBO!.Save()

Endif



Strange is (at least for me, that I do not loop through the file but always return to the first record.

I looked at it in the debigger and I can see that after the first loop, the next record is selected, but after

issuimg the edit command, the BO is positioned back to the first record.

What am I missing here?

Thanks in Advance

Thomas
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
So, after the call to Edit(), the CurrentRowIndex is back to 0?

My guess would be that AutoNavigateToFirstBrokenRow is turned on, the first row has a broken rule, and it's moving to it instead of staying on the current record when Edit() is called.  Try setting AutoNavigateToFirstBrokenRow to false and see if that fixes it.
Thomas Holste
Thomas Holste
StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ben,

I changed AutoNavigateToFirstBrokenRow to False but the behaviour has not changed.

I helped myself by calling the edit method before the loop ans saving after the loop, which works

but I would still like to know what is going wrong there.

Best regards

Thomas
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 Thomas,
  • You don't need to call the BestBO1.Edit() in your doldsabfrage() method, because once you assign a value to the record, it will place the BO in Edit mode.
  • After the loop, check if the BestBO1.IsDirty and then save it.
  • Also sometimes instead of looping with a Loop While, if possible try using the BestBO1.GetEnumerable()


Edhy Rijo

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