Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Automatlically populate a date in the Opportunity form

Posted on 2010-09-17
13
Medium Priority
?
985 Views
Last Modified: 2013-11-24

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.
0
Comment
Question by:apollo7
  • 6
  • 4
  • 3
13 Comments
 
LVL 7

Expert Comment

by:stacko111
ID: 33699771
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
 
LVL 30

Expert Comment

by:Feridun Kadir
ID: 33699773
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
 
LVL 1

Author Comment

by:apollo7
ID: 33699868
Thanks guys, will try the workflow and report back later.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 1

Author Comment

by:apollo7
ID: 33701652
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
 
LVL 30

Expert Comment

by:Feridun Kadir
ID: 33701677
See the attached image.
opp.PNG
0
 
LVL 30

Expert Comment

by:Feridun Kadir
ID: 33701687
Just to say, I didn't realise that the add days only extends to 31. Would adding 2 months work?
0
 
LVL 7

Expert Comment

by:stacko111
ID: 33701691
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
 
LVL 1

Author Comment

by:apollo7
ID: 33701789
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
 
LVL 1

Author Comment

by:apollo7
ID: 33704245
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
 
LVL 7

Accepted Solution

by:
stacko111 earned 2000 total points
ID: 33705666
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
 
LVL 1

Author Comment

by:apollo7
ID: 33707696
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
 
LVL 7

Expert Comment

by:stacko111
ID: 33707726
Your workflow looks ok, however try changing to last part to stop the workflow as canceled rather than succeeded
0
 
LVL 1

Author Closing Comment

by:apollo7
ID: 33710811
Thanks for your help, the workflow is working now.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question