CurrentRecordIsUpdated (System function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 6: Line 6:
CurrentRecordIsUpdated is a member of the [[System class]].
CurrentRecordIsUpdated 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 the current record in the current
indicates whether the current record in the current
record-oriented loop has been updated in the current
record-oriented loop has been updated in the current
transaction.
transaction.
 
The CurrentRecordIsUpdated method is available in ''Sirius Mods'' 7.7 and later.
The CurrentRecordIsUpdated method is available in ''Sirius Mods'' 7.7 and later.
===Syntax===
===Syntax===
Line 23: Line 23:
<dt>%(system)
<dt>%(system)
<dd>The class name in parentheses denotes a shared method.
<dd>The class name in parentheses denotes a shared method.
 
</dl>
</dl>
===Usage Notes===
===Usage Notes===
Line 32: Line 32:
</ul>
</ul>
===Example===
===Example===
 
The following request fragment sketches a record updating loop that reports to
The following request fragment sketches a record updating loop that reports to
the audit trail if this is an initial update for each record in the transaction:
the audit trail if this is an initial update for each record in the transaction:
<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):currentRecordIsUpdated ne true then
      if %(system):currentRecordIsUpdated ne true then
    Audit 'First update of Record num: ' %rec:RecordNumber
        Audit 'First update of Record num: ' %rec:RecordNumber
  end if
      end if
  ...
      ...
end for
    end for
</nowiki></p>
</pre>

Revision as of 16:45, 28 February 2011

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

CurrentRecordIsUpdated is a member of the System class.

This shared function returns a Boolean value that indicates whether the current record in the current record-oriented loop has been updated in the current transaction.

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

Syntax

  %bool = %(system):CurrentRecordIsUpdated

Syntax Terms

%bool
The Boolean enumeration value indicating whether the current record has been updated. For more information about these enumerations, see Using Boolean enumerations.
%(system)
The class name in parentheses denotes a shared method.

Usage Notes

  • RecordIsUpdated reports whether a record you identify by filename and record number has been updated within the current transaction.

Example

The following request fragment sketches a record updating loop that reports to the audit trail if this is an initial update for each record in the transaction:

%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):currentRecordIsUpdated ne true then Audit 'First update of Record num: ' %rec:RecordNumber end if ... end for