opportunity age calculation coding help

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Nishan Perera
    replied
    update as below and worked for me.

    for closed won only

    "select": "DATEDIFF(CASE WHEN opportunity.status = 'closed won' THEN opportunity.completed_date ELSE NOW()END, opportunity.date_identified)",
    "orderBy": "DATEDIFF(CASE WHEN opportunity.status = 'closed won' THEN opportunity.completed_date ELSE NOW() END, opportunity.date_identified ) {direction}",

    or for closed won/lost or multiple

    "select": "DATEDIFF(CASE WHEN opportunity.status IN ('Completed', 'Hold') THEN opportunity.completed_date ELSE NOW()END, opportunity.date_identified)",
    "orderBy": "DATEDIFF(CASE WHEN opportunity.status IN ('Completed', 'Hold') THEN opportunity.completed_date ELSE NOW() END, opportunity.date_identified ) {direction}",

    Leave a comment:


  • Nishan Perera
    replied
    Originally posted by Nishan Perera
    Hi yuri

    I need some support on opportunity age calculation which is now working perfectly. Thing is, I want to stop the age calculation if opportunity stage change to closed won or closed lost.

    thread,

    https://forum.espocrm.com/forum/gene...pportunity-age
    can someone help me on this ?

    Leave a comment:


  • Nishan Perera
    replied
    yuri looking for your support on this request.

    Leave a comment:


  • Nishan Perera
    replied
    hi, can anyone help me out on this ??

    Leave a comment:


  • Nishan Perera
    started a topic opportunity age calculation coding help

    opportunity age calculation coding help


    Hi yuri

    I need some support on opportunity age calculation which is now working perfectly. Thing is, I want to stop the age calculation if opportunity stage change to closed won or closed lost.

    thread,

    Hi, I want a field which is to show age of a particular opportunity with dynamic logic. opportunity age field read only and should update automatically ?? how it can be done ? any help ??

Working...