code: public void addSubFileFilter()
      {
          // Override this if it is not correct.
          SubFileFilter listener = null;
          this.getMainRecord().setKeyArea(BaseFolder.PARENT_FOLDER_ID_KEY);
          this.getMainRecord().addListener(listener = new SubFileFilter(this.getHeaderRecord()));
          if (this.getMainRecord().getKeyArea().getField(DBConstants.MAIN_KEY_FIELD).isNullable() == false)
          {
              listener.setFilterIfNull(true);
              listener.setAddNewHeaderOnAdd(false);
          }
          // Set it back
          if (DBConstants.TRUE.equalsIgnoreCase(this.getProperty("fakeHeader")))
              this.setProperty(DBParams.HEADER_OBJECT_ID, DBConstants.BLANK);
      }
docs: AddSubFileFilter Method.