docs: public BasePanel onForm(Record recordMain, int iDocMode, boolean bReadCurrentRecord, int iCommandOptions, boolean bLinkGridToQuery, Map<String,Object> properties)
      {
          if (recordMain == null)
              recordMain = this.getMainRecord();
          if (recordMain != null)
          {
              ScreenLocation itsLocation = null;
              BasePanel parentScreen = this.getParentScreen();
              if ((iCommandOptions & ScreenConstants.USE_NEW_WINDOW) == ScreenConstants.USE_SAME_WINDOW)	// Use same window
                  itsLocation = this.getScreenLocation();
              else
                  parentScreen = Screen.makeWindow(this.getTask().getApplication());
              boolean bUseBaseTable = true;
              boolean bCloneThisQuery = true;
              if ((iCommandOptions & ScreenConstants.USE_NEW_WINDOW) == ScreenConstants.USE_SAME_WINDOW)	// Use same window
              {
                  parentScreen.popHistory(1, false);
                  parentScreen.pushHistory(this.getScreenURL(), false);  // Update the history to my current state.
              }
              if (bCloneThisQuery)
              {
                  try {
                      Object bookmark = null;
                      if ((recordMain.getEditMode() == Constant.EDIT_CURRENT) || (recordMain.getEditMode() == Constant.EDIT_IN_PROGRESS))
                          bookmark = recordMain.getHandle(DBConstants.BOOKMARK_HANDLE);
                      this.finalizeThisScreen();  // Validate current control, update record, get ready to close screen.
                      if (bookmark == null)
                      {
                          if ((recordMain.getEditMode() == Constant.EDIT_ADD) && (recordMain.isModified()))
                          {
                              recordMain.writeAndRefresh();
                              parentScreen.popHistory(1, false);
                              parentScreen.pushHistory(this.getScreenURL(), false);  // Update the history to my current state.
                          }
                          else
                              recordMain.addNew();
                      }
                      else if ((!bookmark.equals(recordMain.getHandle(DBConstants.BOOKMARK_HANDLE)))
                              || ((recordMain.getEditMode() == Constant.EDIT_NONE) || (recordMain.getEditMode() == Constant.EDIT_ADD)))
                          recordMain.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
                  } catch (DBException e) {
                      e.printStackTrace();
                  }
              }
              BaseScreen screen = (BaseScreen)recordMain.makeScreen(itsLocation, parentScreen, iDocMode | iCommandOptions, bCloneThisQuery, bReadCurrentRecord, bUseBaseTable, bLinkGridToQuery, properties);
              return screen;    // Success
          }
          return null; // Command not processed
      }