You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to auto update lead status to converted when connecting an existing opportunity

Received Response
52
Views
2
Comments
edited Dec 5, 2023 8:37PM in Sales 2 comments

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.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!