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}",
opportunity age calculation coding help
Collapse
X
-
can someone help me on this ?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-ageLeave a comment:
-
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 ??
Tags: None
Leave a comment: