smartlist dowork

John Boehme john at integralservices.biz
Mon Apr 11 22:57:18 UTC 2022


Hi Martin,

It was mentioned to make sure you check that $smartlist was indeed set before the operations on the list took place.

When stepping through the list for work, there is another property, $history, that needs to be used:

Set reference rowRef to $cinst.$history.$first()
While rowRef
  If rowRef.$status=kRowDeleted
..
..
End While
Do $cinst.$savelistdeletes()

Set reference rowRef to $cinst.$history.$first()
While rowRef
  If rowRef.$status=kRowUpdated
..
..
..

This gives you access to the change list that is managed when $smartlist is true.


John Boehme
940-597-3046

-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Martin Obongita via omnisdev-en
Sent: Monday, April 11, 2022 5:08 AM
To: omnisdev-en at lists.omnis-dev.com
Cc: Martin Obongita
Subject: smartlist dowork

Hi All
I am trying to update a smartlist with the following methods:
btnUpdate: $event
Do iOrgGeneralPrefList.$dowork() Returns #F            

taSuperTable: $dowork
Do $cinst.$first()        

While $cinst.$line>0        

Switch $cinst.$status        

Case kRowDeleted        

Do $cinst.$delete()        

Case kRowInserted,kRowUpdated        

Do $cinst.$save()        

End Switch        

Do $cinst.$next()        

End While        

Quit method #F        

taSuperTable: $save
If $cinst.[iPrimaryKeyName]>0 ## already primary key value            

Do $cinst.$update($cinst) Returns #F        

Else        

Do $cinst.$insert() Returns #F        

End If        

The flag in the btnUpdate $event returns kTrue.        But the changes in the smartlist are not updating the table in the database. Where in my code am I going off the rails?
As always, I appreciate all your kind helps.
Martin.
_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list