No announcement yet.

"Calculated by database if blank" option on update

  • Filter
  • Time
  • Show
Clear All
new posts

  • "Calculated by database if blank" option on update


    Is there any way that ScriptCase use the "calculated by the database if empty" option on update?

    I use this option on insert, setting the default value to null at database level for those fields, but each new update fails because Scriptcase tries to update this fields with 0 or '' if I leave them blank.

    One option would be to set all these fields to null in the onBeforeUpdate event, but I would like to leave this to database level.

    I think that if this option is not available, should be implemented by the Scriptcase team, as it would be quite useful.

  • #2
    Yes, It is an error, i posted this error some time ago. For example if a field is Foreign and numeric, and is Null into the form, SC insert/updated this field with value to ZERO.


    • #3
      Thinking a little more on this subject, the option to use the onBeforeUpdate event and replace zeros with null values is invalid and would fail in case you really want to update with zero.
      This is a serious bug since it prevents the use of null as the default value at database level.
      If this is not so, I would appreciate any clarification.


      • #4
        I know previously I had done that in my project, where before the record was saved, I saved the value as null, but I believe I just set the value to null and it worked. I will see if I can find the code. It was in an older project and I'm not sure I ever upgraded it to newer version of SC