Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 10 JUN 2002 10:34:03AM Rudhy B wrote:

In Arev, we can check to see if @record has been modified at presave.

if wc_orec% ne @record then

  • * do processing

end

How do we accomplish the same thing in OI32 ?

Rudhy


At 10 JUN 2002 01:16PM David Kafka wrote:

Rudhy,

Caution: I am a relative OI newbie. I am hopeful someone with more experience will correct me where I am wrong here:

As far as WC_OREC%, that's pretty easy. I believe the best way to get an equivalent is to use a user-defined property "post-read." In other words, on the READ event, you would do this:

*pre-read processing

whatever

FORWARD_EVENT()

* post-read processing

null=Set_Property(@WINDOW,'@OREC',@RECORD)

Return 0

At any subsequent time, you could do:

orec=Get_Property(@WINDOW,'@OREC')

The trick, however, is to find a good value of @RECORD to compare OREC to, once form processing begins. Depending on what you are doing in your form, @RECORD or the 'RECORD' property may or may not reflect the current state of all the information in the form. I have found that various combinations of using edittables and the Calculate event throw @RECORD/'RECORD' out of whack, no matter how much care you use in using 'DEFPROP'/'INVALUE'. Documentation implies that the 'RECORD' property should be correct, but that has not been my experience–I have found that, sometimes, using the Calculate event results in 'RECORD' containing non-current information, and I have had to work around this by recapturing information from the affected controls (I think I have only seen this with edittables, but I am not certain.)

My understanding is that @RECORD is not necessarily recontstituted at any point pre-write, and from what I read, the only time @RECORD is definitively correct is immediately post read. That would mean that you can only count on @RECORD being correct if you let the form write it and then immediately read it back, which doesn't seem to me to be what you want.

Someone out there, or perhaps Revsoft themselves, must have a routine that reads all the controls in a window and creates a reliably accurate @RECORD. After all, the form itself needs to do this in some fashion immediately before it writes the record. Anyone?

David


At 10 JUN 2002 03:13PM Don Miller- C3 Inc. wrote:

Search is your friend . There have been any number of posts on this item. Basically, @RECORD is guaranteed accurate when the record is read from disk or set to blank for a new item. You save this in a user-defined elament .. in fact you can use OREC as the name:

SET_PROPERTY .. with the contents of @RECORD.

Then as a prelude to the actual write, you'll have to reconstruct what @record will be by going through all the database bound controls and updating the contents of @RECORD accordingly. Then you can do your tried-and-true AREV logic to compare @RECORD to your OREC variable and do what you need.

Don Miller

C3 Inc.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/429830c318be862685256bd40050059d.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1