Myron, when potentially updating a row using a form, I project a temp table for that row and perform maintenance on the temp table.
When exiting the form, I update the permanent table from the temp table.
To detect if changes were made, I use the AUTOROWVER Operating Condition; see:
https://www.rbase.com/support/rsyntax/rbgx5/set_autorowver_2.html

AUTOROWVER adds a SYS_ROWVER column to the projected temp table.
Creating the temp table initializes SYS_ROWVER  to 0.
PROJECTING data into the temp table is a change, SYS_ROWVER gets bumped to 1. SYS_ROWVER is subsequently incremented by 1 anytime data in that row is changed.

eg:
  SET ERROR MESSAGE 2038 OFF
  DROP TABLE tTableName
  SET ERROR MESSAGE 2038 ON

  SET AUTOROWVER ON
  PROJECT TEMPORARY tTableName FROM TableName USING * +
   WHERE [select the row]
  SET AUTOROWVER OFF

[Maintenance on the temp table]

Exit:
IF SYS_ROWVER > 1 THEN
  [log user name, update the permanent table from the temp table and what ever else you have to do for changes]
ENDI

There is also a RBTI_DIRTY_FLAG and other methods to accomplish what you want.
AUTOROWVER, to me, is pretty straightforward.

Doug




On 12/3/2023 9:25 AM, myron.fineg...@gmail.com wrote:

Subject: Know when data has been changed in a row of data in a table.

Background:

 1. Using a form to /enter or change data/ that is in a row in a table.
 2. The application has code in place to record who is logged into the
    system.
 3. When exiting, with or without data changes to the row of data, the
    form has code in the exit button that uses an update command to
    take the logged in username and update the column in the row of
    data ‘last updated by’.
 4. Goal: only do that update if the data has actually been changed.

R:Base has a way to check if data has been changed in a row of data when a table is opened and a column in a row has been changed. The save button on the bottom of the screen (the check mark) changes from grey to a color.

Is there a way to know, using code, if the data in a row in a table has changed? This would allow control over the update statement on exit.

Thanks in advance.

Myron Finegold

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/012801da25fc%24f9748400%24ec5d8c00%24%40gmail.com <https://groups.google.com/d/msgid/rbase-l/012801da25fc%24f9748400%24ec5d8c00%24%40gmail.com?utm_medium=email&utm_source=footer>.


--
This email has been checked for viruses by Avast antivirus software.
www.avast.com

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/899b5bf1-b3a0-410b-903c-ee710294b105%40wi.rr.com.

Reply via email to