Triggers: Difference between revisions

5 bytes removed ,  6 October 2016
m
no edit summary
mNo edit summary
mNo edit summary
Line 203: Line 203:
Suppose there is a library containing daily mileage of daily walks or use of a car or bicycle. Suppose the library has a StartingMileage field and a Mileage field. When an entry is created, the field StartMileage must get data from the field Mileage in the previous entry.
Suppose there is a library containing daily mileage of daily walks or use of a car or bicycle. Suppose the library has a StartingMileage field and a Mileage field. When an entry is created, the field StartMileage must get data from the field Mileage in the previous entry.


<source lang="javascript" line>
<source lang="javascript">
var entries = lib().entries();                      // Get the current library and an array of its entries
var entries = lib().entries();                      // Get the current library and an array of its entries
if (entries.length > 0) {                          // Check that the array is not empty; otherwise exit,
if (entries.length > 0) {                          // Check that the array is not empty; otherwise exit,