RecordIsUpdated (System function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 6: Line 6:
RecordIsUpdated is a member of the [[System class]].
RecordIsUpdated is a member of the [[System class]].
</p>
</p>
 
This shared function returns a Boolean value that
This shared function returns a Boolean value that
indicates whether a record you specify (by file name and record number)
indicates whether a record you specify (by file name and record number)
has been updated in the current transaction.
has been updated in the current transaction.
 
The RecordIsUpdated method is available in ''Sirius Mods'' 7.7 and later.
The RecordIsUpdated method is available in ''Sirius Mods'' 7.7 and later.
===Syntax===
===Syntax===
Line 27: Line 27:
<dt>recnum
<dt>recnum
<dd>The number of the record whose update status you are querying.
<dd>The number of the record whose update status you are querying.
 
</dl>
</dl>
===Usage Notes===
===Usage Notes===
Line 35: Line 35:
</ul>
</ul>
===Example===
===Example===
 
The following request fragment sketches a record loop that reports to
The following request fragment sketches a record loop that reports to
the audit trail if this will be the initial update in the transaction for the
the audit trail if this will be the initial update in the transaction for the
records that satisfy a particular condition:
records that satisfy a particular condition:
<pre style="xmp">
<p class="code"><nowiki>%recs is object recordset in file myfile
    %recs is object recordset in file myfile
%rec is object record in file myfile
    %rec is object record in file myfile
 
fd to %recs
    fd to %recs
end find
    end find
for each record in %recs
    for each record in %recs
  ...
      ...
  %rec = CurrentRecord
      %rec = CurrentRecord
    if %(system):RecordIsUpdated($curfile, $currec) ne true then
        if %(system):RecordIsUpdated($curfile, $currec) ne true then
      Audit 'First update of Record num: ' %rec:RecordNumber
          Audit 'First update of Record num: ' %rec:RecordNumber
    end if
        end if
  ...
      ...
  end if
      end if
end for
    end for
</nowiki></p>
</pre>

Revision as of 16:47, 28 February 2011

<section begin=dpl_desc/>Has specified record been updated?<section end=dpl_desc/>

RecordIsUpdated is a member of the System class.

This shared function returns a Boolean value that indicates whether a record you specify (by file name and record number) has been updated in the current transaction.

The RecordIsUpdated method is available in Sirius Mods 7.7 and later.

Syntax

  %bool = %(system):RecordIsUpdated(filename, recnum)

Syntax Terms

%bool
The Boolean enumeration value indicating whether the record has been updated. For more information about these enumerations, see Using Boolean enumerations.
%(system)
The class name in parentheses denotes a shared method.
filename
A string that is the name of the file that contains the record whose update status you are querying.
recnum
The number of the record whose update status you are querying.

Usage Notes

  • CurrentRecordIsUpdated reports whether the currently selected record has been updated within the current transaction.

Example

The following request fragment sketches a record loop that reports to the audit trail if this will be the initial update in the transaction for the records that satisfy a particular condition:

%recs is object recordset in file myfile %rec is object record in file myfile fd to %recs end find for each record in %recs ... %rec = CurrentRecord if %(system):RecordIsUpdated($curfile, $currec) ne true then Audit 'First update of Record num: ' %rec:RecordNumber end if ... end if end for