public int preFind(
      SessionContext ctx,
      DatabaseConnection conn,
      FormInstance instance,
      ErrorMessages msgs,
      EventManager manager,
      PreparedStatement ps,
      PreparedStatement countps) {

    String value = ClientSum.getClientSum(strClientNO, "CMCORPCAPITAL", "CONTRACTAMT", conn);
    String value2 = ClientSum.getClientSum(strClientNO, "CMCORPCAPITAL", "ACTUALAMT", conn);
    ctx.setAfterBody("CONTRACTAMT=" + value + ";ACTUALAMT=" + value2 + "");

    try {
      ps.setString(1, strClientNO);
      countps.setString(1, strClientNO);
      if (strFlag.equals("write")) instance.setReadonly(false);
      else instance.setReadonly(true);
      return 0;
    } catch (SQLException se) {
      return -1;
    }
  }