Announcement

Collapse
No announcement yet.

Is there a formula that calculates the due date?

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

  • Is there a formula that calculates the due date?

    Click image for larger version

Name:	image.png
Views:	72
Size:	3.5 KB
ID:	112259

    Is there a formula that automatically enters the due date and calculates the due date?

    I tried it but it didn't work; ifThen(not(empty(dueDay)),cDateDate= datetime\diff(today(), cDateDay, 'day'));​​

  • #2
    This formula will suit you: https://docs.espocrm.com/administrat...atetimeadddays

    - Three fields are created:
    1. Number of days - Integer type;
    2. Due Date - Date type;
    3. Date Date - Date type.

    - In Administration > Entity Manager > Your_entity_name > Formula > Before Save Custom Script enter the formula (be careful when specifying field names, because they may not start with "c"):
    HTML Code:
    cDueDate = datetime\addDays(cDateDate, cNumberOfDays);
    - You get an automatic calculation in the Due Date field:

    Click image for larger version  Name:	image.png Views:	0 Size:	4.6 KB ID:	112262
    If adding or subtracting days is focused only on the current date, then you do not need the Date Date field and the formula will look like this:
    HTML Code:
    cDueDate = datetime\addDays(datetime\now(), cNumberOfDays);
    Last edited by victor; 11-13-2024, 11:10 AM.

    Comment


    • #3
      Click image for larger version

Name:	image.png
Views:	43
Size:	5.8 KB
ID:	112285
      Hello victor how are you

      I did what you said but it didn't work. Where am I going wrong? Click image for larger version

Name:	image.png
Views:	38
Size:	17.6 KB
ID:	112286

      Comment


      • #4
        Did you recalculate formula?

        Comment


        • #5
          Yes, I calculated it but it still didn't come. Stefan

          Comment


          • #6
            Judging by your screenshot, you have confused field Labels and field Names.
            Please send screenshots of the settings of all three fields used in the formula.​

            Comment


            • #7
              No, that's how I defined it.

              Comment


              • victor
                victor commented
                Editing a comment
                You did not send the screenshots that I requested from you, without them it's difficult to say anything.

                As for the formula, it works as it should (checked both formulas personally).
            Working...
            X