Announcement

Collapse
No announcement yet.

Date Difference

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Date Difference

    Hi,
    I have created an entity called Leaves that has two date fields: fromDate and toDate. I also created a read only INT field daysRequested.

    I created this formula for my entity:
    daysRequested = (toDate - fromDate) + 1

    That is supposed to calculate the number of days between the two date fields.

    The values I get for whatever dates I submit is 1 which tells me the difference between toDate and fromDate is not working.

    What am I doing wrong? Is there a function to subtract two dates?

    Thank you.

  • #2
    Don't see how to realize it with Formula.
    But you can develop it.
    On version 4.4.1 open /application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json, look at field "duration". You need "select" and "orderBy" parameters

    Comment


    • #3
      Thanks for the tricks Tanya !! I had the same need!

      Comment

      Working...
      X