How to auto update lead status to converted when connecting an existing opportunity
Summary:
When we connect an existing Opportunity to a new Lead, we are looking for a way to auto update the Lead status to Converted.
Content (please ensure you mask any confidential information):
According to this older support article, there is a script trigger that can accomplish this, but it is not working.
Script template is below:
BeforeUpdate on Sales Lead:
***************************
def var_Lead = LeadOpportunity
def numberOfOpty = var_Lead.getEstimatedRowCount()
println(numberOfOpty)
if(numberOfOpty>0){
setAttribute("StatusCode","CONVERTED")
}
***************************
We tried three things that did not work.
- getEstimatedRowCount() on the LeadOpportunity. We tried getEstimatedRowCount() on LeadOpportunity copying the example provided in MOS document 2364500.1. However, the Groovy editor in AppComposer says getEstimatedRowCount() doesn't exist.
Tagged:
0