datetime\diff()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • artcien
    Junior Member
    • Jan 2018
    • 18

    datetime\diff()

    This calculated field formula does not appear to be working.

    The field daysUntilClosing is Varchar

    daysUntilClosing = datetime\diff(closeDate, datetime\today(), 'days');
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello
    Just finished the testing of it on the demo. It works well. But only after saving. If you don't modify the record, formula doesn't trigger

    Comment

    • artcien
      Junior Member
      • Jan 2018
      • 18

      #3
      Hi tanya

      I just realized that it works perfectly on some records and others it shows 'None' (even after updating record)

      This is what I get on my log

      [2018-02-20 15:53:22] Espo.ERROR: Formula failed: [] []
      [2018-02-20 15:53:42] Espo.ERROR: Formula failed: [] []
      [2018-02-20 15:53:52] Espo.ERROR: Formula failed: [] []
      [2018-02-20 15:54:40] Espo.ERROR: Formula failed: [] []

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        Possible reasons:

        1. closeDate could be incorrect.
        2. you could have other rules in formula before. One of them failed, the next weren't triggered.

        Comment

        • artcien
          Junior Member
          • Jan 2018
          • 18

          #5
          I realized that if I create a new record the formula works, but does not work with records that are older and were created prior to the additional fields and formula.

          It's like the database it not updating old records for those new fields.

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            Formula works for old record as well, if you set a correct rule. Check your rules again

            Comment

            Working...