Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • To set the value of the iiiEmployYears fields to be the number of years the employee has been with the company.

1.  Select the iiiEmployYears field in the list of Undefined virtuals.

2.  In the Details tab, enter the following:

Virtual field type

Code Fragment

Derive value when record is readü

Image Added Select this option


3.  In Virtual Field Derivation, add the following code:

     #iiiEmployYears := #iiiStartDate.Date.Now.Difference( #iiiStartDate ) / 365

     Change Change the code to use your initials.

     Your Your Details tab should now look like this:

...

    The code fragment uses intrinsic methods Date and Difference to compare the date portion of the iiiStartDate field with today's date and divides the result by 365.

     All your virtual fields are now listed under Read Virtuals.

Image Modified

6.  Compile the table and ensure the compilation ends without errors. The compile simply needs to rebuild the OAM.