Capturing age of an opportunity when its closed won

I'm trying to calculate the age of an opportunity when the opportunity stage becomes “Closed Won”.  I used the steps as described in SugarCRM knowledge base - "Capturing the Age of Closed Won Opportunities”  yet it's not working properly. After saving the record the attached error message occurs.

I've only slightly adapted the formula to the fields we're using. 

Knowledge base:

ifElse(and(equal($sales_stage,"Closed Won"),equal($closed_won_cbk_c,false)),today(),date(""))

 

Ours: 

ifElse(and(equal($icc_probability,"closed"),equal($closed_won_cbk_c,false)),today(),date(""))

I can't figure out why the error occurs as I followed all the steps in the instruction. Is there a bug related to this?

Thanks in advance. 

Parents
  • Hi Jaqueline Bargmann,

    Is it resolved now? If not, please try the following and let us know if it works.

    ifElse(and(equal($icc_probability,"closed"),equal($closed_won_cbk_c,false)),today(),date("NULL"))

    i.e. pass "NULL" in date() formula.

    Regards.

  • I had the same desire and resolved it by creating a field (in multiple modules) that I called something like: "Days in Process".  Then a simple addition to a Process (or a new process) was written to Add "1" to the field, Wait one day, then check the status - if it was still in the same state, I'd exit, otherwise, add "1" to the field, and loop back to the "wait one day".

    I have a number of these where I'm counting days.

    The second thing I've done for some of the modules is to have a process that captures the date when something is changed to a particular value, then when the value changes the process calculates the difference between the two dates and populates a field.

    We don't have any SQL coding in our implementation and do everything through Studio and Workflows.  I hope this helps.

    Bud Hartley | Cape Foulwind, NZ (and Oregon, USA)

Reply
  • I had the same desire and resolved it by creating a field (in multiple modules) that I called something like: "Days in Process".  Then a simple addition to a Process (or a new process) was written to Add "1" to the field, Wait one day, then check the status - if it was still in the same state, I'd exit, otherwise, add "1" to the field, and loop back to the "wait one day".

    I have a number of these where I'm counting days.

    The second thing I've done for some of the modules is to have a process that captures the date when something is changed to a particular value, then when the value changes the process calculates the difference between the two dates and populates a field.

    We don't have any SQL coding in our implementation and do everything through Studio and Workflows.  I hope this helps.

    Bud Hartley | Cape Foulwind, NZ (and Oregon, USA)

Children
No Data