Plex 2E

 View Only

 In Synon how to compare/check many screen fields for changes.

Gcox's profile image
Gcox posted Feb 29, 2024 02:09 PM

I have a Synon CA/2e edit record (EDTRCD) with over 30 fields and I need to know if one of them changed.  I don't want to check each one individually - I know there is better way to accomplish this.

Eamonn Foley's profile image
Eamonn Foley

I'm going with the assumption that you don't care which field changed only that 1 changed.

  1. Create an array with 1 row.
  2. Define the array with every field you want to test.
  3. Create 2 array functions.  First is a create object, second is a delete object with no keys (to clear the array).
  4. In the edit record:  USER: Initialize detail screen (existing record).  Call the delete to clear the array, then call the create and put all the fields into the array.
  5. Use the *CVTVAR function to move the array to a text field large enough to hold all the data.
  6. In the user point USER: Validate detail screen relations (or wherever you are testing for changes) Repeat the array steps (clear and load).
  7. Use the *CVTVAR function to move the array to a second text field large enough to hold all the data.
  8. Compare the text fields from 5 and 7, if they are different, something changed.

You could try doing it with an array with 2 records and keyed by every field but i can't remember if there is a limit on the number of keys in an array.  If you try this, make sure to suppress the duplicate record message.