Override $doupdate() for a smart list.

Gordon Wilson g_r_wilson at yahoo.com
Sat May 29 21:12:04 UTC 2021

Hi @All

I am trying to understand the Omnis way of doing SQL. I have a customer using my first implementation being an update of an existing customer's Omnis system and have been delighted (mostly) with the many benefits over using the Omnis standard data file. 

In all of this, I have used the methodology developed by Das Giovani with the exception of one window I have added as an addition to the old program. This window uses a smart list based on class wizard. In this case I have Groups as a parent and Stock as a child. Groups are simply stock categories.

Editing stock using a window that accesses one stock record at a time, I can override the $update method to include a timestamp and user just like Jim Pistrang does in his video on Youtube.

My question is, how is this done by overriding $doupdate or $doupdates for a smartlist?

>From the manual I see this... (Note the last sentence)

 Do MyRow.$updatenames() Returns UPDATETEXT
Returns a text string in the format: SET TABLE.col1=@[$cinst.col1],TABLE.col2=@[$cinst.col2],
where col1...coln are the server column names of the columns in the row variable. Eachcolumn name is qualified with the name of the server table. Do MyRow.$updatenames([old_name]) Returns UPDATETEXT
The optional parameter old_name is the name of a row variable to be used to generate a ̳where‘ clause. If you include old_name, a ̳where‘ clause is concatenated to the returnedstring in the following format: WHERE col1=@[old_name.col1] AND ... AND colN=@[old_name.colN]
The columns in the where clause depend on the setting of $useprimarykeys. If$useprimarykeys is kTrue, then the columns in the where clause are those columns markedas primary keys in their schema class. Otherwise, the columns in the where clause are allnon-calculated columns except those with data type picture, list, row, binary or object. 

You can replace $cinst in the returned string using:    Do MyRow.$updatenames([old_name][,row_name]) Returns UPDATETEXT
where row_name is the name of row variable which Omnis uses in the bind variables. Thismay be useful if you override $doupdate() for a smart list.
This is a clue but I have no idea how to do this.

Any advice here would be much appreciated.

Kind regards, Gordon.

More information about the omnisdev-en mailing list