Automatlically populate a date in the Opportunity form


When I convert a Lead to an Opportunity, I want to populate the estimated closing date in Opportunity as the current date plus 60 days.  

Key requirement: the estimated closing date should only be auto-populated as date + 60 days when the Opportunity is created from a Lead.

Thanks for your help.
LVL 1
apollo7Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
stacko111Connect With a Mentor Commented:
You need to put in a conditional branch, do this by selecting the If statement then going to insert. When you insert it you will see it in line with the first If statement.

At the moment your workflow is only fired when the Originating Lead does not contain data.

Also set it run for Organisation.
0
 
stacko111Commented:
Have you tried using a Workflow to accomplish this? The primary Entity would be Opportunity and the Workflow would be fired when the Opportunity is created.

Then put in a Condition to say If the Opportunity Lead field Contains Data update the Estimated Close Date to be 60 days after the Created On Date.

You should also put a Conditional Branch in to stop (cancel) the workflow if there is nothing in the Opportunity Lead field.
0
 
Feridun KadirPrincipal ConsultantCommented:
I would do this in workflow using an automatic trigger of a New Opportunity.

The workflow should first test if the Originating Lead field is blank - if it is then the workflow ends otherwise the workflow continues (the opportunity must have been created from a lead).

Then create an Update Record step to sets the Est. Close Date to today (you could Opportunity Created On as that will be today) plus 60 using the Dynamic Field assistant.

I'm suggesting Workflow rather than Javascript because it is a little easier. Also when a new opportunity is created from a lead the user might not ask to open the new record in which case the javascript won't run until the opportuinity is opened.

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
apollo7Author Commented:
Thanks guys, will try the workflow and report back later.
0
 
apollo7Author Commented:
Question on this (so far so good, btw) - can you tell me the syntax of the 'current date' to be inserted in the workflow step (which then will have 60 days added to it)

Thanks
0
 
Feridun KadirPrincipal ConsultantCommented:
See the attached image.
opp.PNG
0
 
Feridun KadirPrincipal ConsultantCommented:
Just to say, I didn't realise that the add days only extends to 31. Would adding 2 months work?
0
 
stacko111Commented:
You don't need the current date, you just need to set the Estimated Close date to be 60 days after the Created On date. This can be set using the fields on the right hand side of the workflow field screen.
0
 
apollo7Author Commented:
Thanks again - I am using the Created On date but thought there might be a better way / but Created On works for me.  Also, two months is sufficient for the added days / we just want a estimate to start with.

Thank you both for your help.
0
 
apollo7Author Commented:
My workflow is not working as formatted below:

Created a new blank workflow using Opportunity as the Entity
Publish as: Workflow

Scope: Have tried all from user to organization (same result)
Start When: Record is created

First step: Check if Originating Lead is blank
  If 'Opportunity: Originating lead does not contain data', then

Second step: Stop workflow when when orig lead blank
  Stop workflow with status of 'Canceled'

Third step: Update Est Close Date on Opportunity
  Update: Opportunity [Set properties]

Properties are {Days: 30 After Created On} - have tried many different date:time fields

I have also attached a bitmap of my setup, I can create a Lead, convert and it does not populate Est Close Date (but places a value in Originating Lead)

Also, If I open an new Opportunity, it populates the Est close Date with Created On + 30

Thanks for your help

EstCloseMain.jpg
0
 
apollo7Author Commented:
Thanks for the tips - I now have it half working / when I create a lead and convert it to an opportunity, it populates the Est Close Date (and originating lead is populated, as well)

The issue is that if I create an Opportunity by clicking New, it also populates the Est Close Date (even though originating lead is blank)

I have included an image below.

Thanks

EstCloseDate.jpg
0
 
stacko111Commented:
Your workflow looks ok, however try changing to last part to stop the workflow as canceled rather than succeeded
0
 
apollo7Author Commented:
Thanks for your help, the workflow is working now.
0
All Courses

From novice to tech pro — start learning today.