BO-Movenext and Edit


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 reputation)StrataFrame User (298 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
Reply
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K 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