How To Add Days Based On Another Date Field?

Hello, I'm trying to create a duration panel for a subscription related data fields.

There are three fields

  1. Subscription Duration (Dropdown Field)
  2. Subscription Start Date (Date Field)
  3. Subscription End Date (Date Field)

Wherein:

  • Subscription Duration has the following dropdown options:
    • 1 Month
    • 2 Months
    • 3 Months
    • etc

What I'm trying to setup:(Sample Scenario)

  • Subscription Start Date = June 15, 2021
    • IF Subscription Duration = 1 Month, 2 Months, etc
    • THEN add days to Subscription End Date

Expected Result:

Sample A

  • Subscription Duration: 1 Month
  • Subscription Start Date: June 15, 2021
  • Subscription End Date: July 15, 2021

Sample B

  • Subscription Duration: 3 Months
  • Subscription Start Date: June 15, 2021
  • Subscription End Date: September 15, 2021

Does anyone know the Sugar Logic Formula to do this?

Parents Reply
  • Yea, if to know the pitfalls about adding days to dates, one would think twice about using adddays to automate the calculation like this :)

    When the calc field calculates the wrong value, it is impossible to fix the value manually. 

    That is why IMHO logic hooks configuring or using BPM is the best option to automatize such calculations (help the human with calculation, so that human could adjust the value) rather than to automate calculation (make it instead of a human with no chance to adjust the results).

    Automatizing could be done with no Sugar coding experience

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient

Children
No Data