Solved

Automatlically populate a date in the Opportunity form

Posted on 2010-09-17
13
933 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 29

Expert Comment

by:feridun
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
 
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 29

Expert Comment

by:feridun
ID: 33701677
See the attached image.
opp.PNG
0
 
LVL 29

Expert Comment

by:feridun
ID: 33701687
Just to say, I didn't realise that the add days only extends to 31. Would adding 2 months work?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now