smartlist dowork
Martin Obongita
martin.obongita at yahoo.com
Tue Apr 12 15:50:36 UTC 2022
Hi all, I have looked in the hub for sample libraries that could show how to insert or update a smartlist. I didn't seem to find any. Does anyone here have a snippet on how to insert and/or update a smartlist? Kind regards, Martin O.
On Monday, April 11, 2022, 10:58:58 PM GMT+3, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
Hi Das,
Thanks for your ideas.
I have a remote task rtMonirot that logs to postgres server and then creates a session.An error is returned if the session is null.
How do I check that the session is still logged on when I am updating a smartlist?
Rgds,
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
_____________________________________________________________
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