Deleting a field with the datetime data type

AlexWileyAlexWiley Member Posts: 230
I was surprised I didn't see this posted elsewhere when searching, so if this is a repeat I apologize. I'm trying to clear out a datetime field so I can remove the column from a table object, but even with the SQL value set to allow null and null being the default, it still defaults a date time and won't let me remove it. I appreciate any insights on getting this field removed!

Comments

  • BeliasBelias Member Posts: 2,998
    DON'T PUT 'NULL' SQL VALUES IN NAVISION DATABASE, UNLESS YOU WANT TO HAVE SOME TROUBLE!!!
    create a codeunit in navision:
    mytable.reset;
    mytable.modifyall(myfield,0DT,[runtrigger]);
    
    it is correct to have that default datetime, this is how nav works
    EDIT: where "runtrigger" is true or false...see online help if you don't know this function
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • AlexWileyAlexWiley Member Posts: 230
    Yeah, I think I created some major issues for myself with the null values. That's what dev environments are for though, right? :D

    Restarted and used your code, worked perfectly to clear the field out, thank you very much!
  • BeliasBelias Member Posts: 2,998
    you're welcome!
    null value for code and text: '' (double quotemark)
    null value for decimal and int: 0
    null value for datetime = 0DT
    null value for date = 0D
    null value for time = 0T
    universal nullifier = function CLEAR(variable)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.