smartlist dowork

Martin Obongita martin.obongita at yahoo.com
Tue Apr 12 15:56:01 UTC 2022


 Hi Das,
Das: Did it surely step over the update and insert commands?    Me: yes. the line     
Do $cinst.$update($cinst) Returns #F
returns 0    

Das: Which goes to are you surely logged on    Me: yes, before I update record, I have this line:    
Do $cinst.$sessionobject.$assign(tSessionObj)    
successfully connected to postgres server        

Martin.

    On Monday, April 11, 2022, 08:39:08 PM GMT+3, Das Goravani <goravanis at gmail.com> wrote:  
 
 The fact that your button event returns flag true is not relevant given you’re not returning the flag out of your save method, and that last .$next() may return a flag and thus mislead you. So forget that flag.

Not updating database… your code is pretty simple, so the suspect part is clear to see.. 

Have you stepped through it with good sample data in list with some changes or inserts

Did if fork to your save method like it’s supposed to

Did it surely step over the update and insert commands?

If it did and no data was update/inserted then you have to wonder about your connection

Which goes to are you surely logged on
Do you have thus your log on objects, statement and other...
And you’re putting other into this list
Thus blessing it with abilities to update data
Blessing it with connection to the data

If those things aren’t in place and active then data won’t update

Sorry I temporarily forgot the names of things, I haven’t coded lately.. 

I don’t know why but I found sometimes $cinst didn’t work right, and I had to go to putting in the list name in a variable in square brackets where $cinst goes, but I hope that is not the case for you and that it works as it should


> On Apr 11, 2022, at 8:08 AM, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> 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 

_____________________________________________________________
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