code: public void run()
      {
          Packages recPackages = (Packages)this.getMainRecord();
          ProgramControl recPackagesControl = (ProgramControl)this.getRecord(ProgramControl.PROGRAM_CONTROL_FILE);
          try {
              recPackagesControl.edit();
              recPackagesControl.getField(ProgramControl.LAST_PACKAGE_UPDATE).setValue(DateTimeField.currentTime());
          
              this.scanProjects(0);
          
              recPackages.setKeyArea(Packages.ID_KEY);
              recPackages.close();
              while (recPackages.hasNext())
              {
                  recPackages.next();
                  Date timePackages = ((DateTimeField)recPackages.getField(Packages.LAST_UPDATED)).getDateTime();
                  Date timeUpdated = ((DateTimeField)recPackagesControl.getField(ProgramControl.LAST_PACKAGE_UPDATE)).getDateTime();
                  boolean bManual = recPackages.getField(Packages.MANUAL).getState();
                  if (((timePackages == null) || (timePackages.before(timeUpdated)))
                      && (bManual == false))
                  {
                      recPackages.edit();
                      recPackages.remove();
                  }
              }
              recPackagesControl.set();
          } catch (DBException ex)    {
              ex.printStackTrace();
          } finally {
              recPackagesControl.free();
          }
      }
docs: Run Method.