Calender Application - Does not Save Record or Show Events

Hi,

I created two applications. One is using the Form and the other is using the Calendar for the same table. I noticed when I try
to save a record from the Calendar Application it refreshes the Calender page but does not actually save the record. And I also created tasks from the Form application but they are not showing up on the calendar.

Debugging the the page in Firebug for Firefox shows the following error:

ReferenceError: $ is not defined
var $oElem    = $(document.getElementById(sElem)),

And here is the response from one of the ajax requests

<DIV id="id_error_display_fixed" style="position: absolute"><TABLE class="scFormErrorTable" align="center">
 <TR>
  <td style="padding: 0px" rowspan="2"><img src="/scriptcase/app/myTasks/_lib/img/scriptcase__NM__icnMensagemAlerta.png" style="border-width: 0px" align="top"></td>
  <TD class="scFormErrorTitle" align="left">
   <table style="border-collapse: collapse; border-width: 0px; width: 100%">
    <tr>
     <td class="scFormErrorTitleFont" style="padding: 0px; width: 100%">
      Error     </td>
     <td><a  title="Close" style="vertical-align: middle; display:inline-block;" onClick="document.getElementById('id_error_display_fixed').style.display = 'none'; document.getElementById('id_error_message_fixed').innerHTML = ''; return false; return false;"><img  src="/scriptcase/app/myTasks/_lib/img/scriptcase__NM__nm_ScriptCase6_BlueSoft_berrm_clse.gif" style="border-width: 0; cursor: pointer" /></a>
</td>    </tr>
   </table>
  </TD>
 </TR>
 <TR>
  <TD class="scFormErrorMessage" align="center"><span id="id_error_message_fixed"></span></TD>
 </TR>
</TABLE></DIV>
<script type="text/javascript">
 function scCenterFixedElement(sElem)
 {
  if (!document.getElementById(sElem))
  {
   return;
  }
  var $oElem    = $(document.getElementById(sElem)),
      $oWindow  = $(this),
      iElemTop  = Math.round(($oWindow.height() - $oElem.height()) / 2),
      iElemLeft = Math.round(($oWindow.width()  - $oElem.width())  / 2);
  $oElem.offset({top: iElemTop, left: iElemLeft});
 }
 var iFixedErrorSqlId = 1;
 function scAjaxFixedErrorSql(sErrorMsg)
 {
  var iTmpPos = sErrorMsg.indexOf("{SC_DB_ERROR_INI}"),
      sTmpId;
  while (-1 < iTmpPos)
  {
   sTmpId    = "sc_id_fixed_error_sql_" + iFixedErrorSqlId;
   sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "<br /><span style=\"text-decoration: underline\" onClick=\"$('#" + sTmpId + "').show(); scCenterElement(document.getElementById('" + sTmpId + "'))\">" + sErrorMsg.substr(iTmpPos + 17);
   iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_MID}");
   sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "</span><table class=\"scFormErrorTable\" id=\"" + sTmpId + "\" style=\"display: none; position: absolute\"><tr><td>" + sErrorMsg.substr(iTmpPos + 17);
   iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_CLS}");
   sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "<br /><br /><span onClick=\"$('#" + sTmpId + "').hide()\">" + sErrorMsg.substr(iTmpPos + 17);
   iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_END}");
   sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "</span></td></tr></table>" + sErrorMsg.substr(iTmpPos + 17);
   iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_INI}");
   iFixedErrorSqlId++;
  }
  return sErrorMsg;
 }
 document.getElementById("id_error_message_fixed").innerHTML += scAjaxFixedErrorSql("Error inserting:<BR>Unknown column 'N' in 'field list'<BR>{SC_DB_ERROR_INI}View SQL{SC_DB_ERROR_MID}INSERT INTO tasks (folder_id, task_type_id, priority_id, importance_type_id, title, contents, progress, start_date, end_date, due_date, start_time, end_time, recurrence, period) VALUES (1, 2, 1, 1, '1111', '<p>1111</p>', 0, '2013-07-02', '2013-07-02', null, null, null, N, 'D'){SC_DB_ERROR_CLS}Close{SC_DB_ERROR_END}");
 scCenterFixedElement("id_error_display_fixed");
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <title></title>
 <script type="text/javascript" src="/scriptcase/prod/third/jquery/js/jquery.js"></script>
 <script type="text/javascript">
  $(document).ready(function() {
    self.parent.calendar_reload();
    self.parent.tb_remove();
  });
 </script>
</head>
<body>
</body>
</html>

Let me know if you need more information.

Hi,

I just wanted to let you know I was able to fix the problem. The problem was that in my table I had a column that had the NOT NULL setting set. So, when I tried to save a record from the calendar application, it threw an error message.

But instead of displaying the error message the calendar app would refresh the page.

Debugging the AJAX request in Firebug revealed the error.

It is working now :slight_smile:

By the way… this means a bug does exist in the calendar application. Here’s how to reprouce the error:

  1. Manually create the table for the Calendar
  2. Add a new column, and make it NOT NULL
  3. In the calendar application fields settings, do not include the column you created on step two.
  4. Generate the calender and try to save a new record
  5. You will notice the record does not get created and also script case does not show the error message.

But if you debug the AJAX requests, the HTML output shows a mysql error message “[column_name] cannot be null”

Thanks for taking the time to followup on your own post. Very helpful!
Jamie

Your statement is confusing, there is no setting called “not-null”.
Do you actually fixed the problem by setting NULL=TRUE or NULL=FALSE

Arthur

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann