Answered by:
How insert today's date into a merge or workflow?

Question
-
Is there a way to insert today's date? I don't see that as an option to insert. Closest I can find would be created on, or modified on dates.
This will be for email templates, mail merge templates and letters and emails in workflows.
Wednesday, April 21, 2010 1:19 PM
Answers
-
Brian,
Here is what we do - In the Look For picklist select local values - Workflow, then select Execution Time in the dependent picklist and insert this into the date field. This should give you what you want - the date will be equivalent to a "today's date" picklist item if it existed.
Jerry http://www.crminnovation.com- Proposed as answer by Henrik Jensen - CRMBlog.dk Wednesday, April 21, 2010 1:35 PM
- Marked as answer by Jim Glass Jr Wednesday, April 21, 2010 4:03 PM
Wednesday, April 21, 2010 1:32 PM -
Hi Brian,
You might want to understand Workflow Execution Time better.
Correct use of "Execution Time".
The CRM workflow designer provides a property called "Execution Time" which can be used in dynamic expressions such as "if Account(CreatedOn) + 10 days < workflow(ExecutionTime)". The meaning of this property is neither the time at which the workflow is published nor the time the workflow instance starts. The actual value of this property is the real time when the workflow evaluates an expression that contains this property. Therefore, expressions such as "Wait until 1 day after workflow(ExecutionTime)" will never succeed and the workflow will wait and resume once a day forever causing performance problems. If you want your workflow to wait for a specific amount of time you should use the wait step and configure the condition as: workflow – timeout – equals – {Duation}. This will unload the workflow and resume execution after the specified time duration has passed.
Also have a look at http://blogs.msdn.com/crm/archive/2010/01/15/microsoft-dynamics-crm-workflow-authoring-best-practices.aspx to better understand workflows.
Best Regards,
Gagandeep Singh
http://mscrmnovice.blogspot.com- Marked as answer by Jim Glass Jr Wednesday, April 21, 2010 4:03 PM
Wednesday, April 21, 2010 1:38 PM
All replies
-
Brian,
Here is what we do - In the Look For picklist select local values - Workflow, then select Execution Time in the dependent picklist and insert this into the date field. This should give you what you want - the date will be equivalent to a "today's date" picklist item if it existed.
Jerry http://www.crminnovation.com- Proposed as answer by Henrik Jensen - CRMBlog.dk Wednesday, April 21, 2010 1:35 PM
- Marked as answer by Jim Glass Jr Wednesday, April 21, 2010 4:03 PM
Wednesday, April 21, 2010 1:32 PM -
Hi Brian,
You might want to understand Workflow Execution Time better.
Correct use of "Execution Time".
The CRM workflow designer provides a property called "Execution Time" which can be used in dynamic expressions such as "if Account(CreatedOn) + 10 days < workflow(ExecutionTime)". The meaning of this property is neither the time at which the workflow is published nor the time the workflow instance starts. The actual value of this property is the real time when the workflow evaluates an expression that contains this property. Therefore, expressions such as "Wait until 1 day after workflow(ExecutionTime)" will never succeed and the workflow will wait and resume once a day forever causing performance problems. If you want your workflow to wait for a specific amount of time you should use the wait step and configure the condition as: workflow – timeout – equals – {Duation}. This will unload the workflow and resume execution after the specified time duration has passed.
Also have a look at http://blogs.msdn.com/crm/archive/2010/01/15/microsoft-dynamics-crm-workflow-authoring-best-practices.aspx to better understand workflows.
Best Regards,
Gagandeep Singh
http://mscrmnovice.blogspot.com- Marked as answer by Jim Glass Jr Wednesday, April 21, 2010 4:03 PM
Wednesday, April 21, 2010 1:38 PM -
Thanks for the explanation.
So it seems you are saying I shouldn't use execution time for today's date, correct?
Do you have a way that I can enter today's date into my letters? Seems like something basic we'd all want in a business letter.
Wednesday, April 21, 2010 3:55 PM -
Brian,
Your question was about getting today's date into the template. My suggestion is correct. The other response relates to using it in some other workflow logic.
Give it a test.
Jerry http://www.crminnovation.comWednesday, April 21, 2010 4:30 PM -
Thanks. I tested it, and now that generates two more questions, if you don't mind.
1. It inserted today's date AND the time. How do I format this to show just the date? I've done this in Word before, is it similar? Something like, DATE - \@ "MM/dd/yy" and if so, where does that go?
Also, and this is a very basic question, how do I print the letter? When it generates the letter, it looks more like an activity page. When I hit print, it includes everything about the task of creating the letter. The date, the owner, etc. with the body of the letter somewhere in the middle. I want to print the actual letter I'm going to mail to my client.
Wednesday, April 21, 2010 6:25 PM -
I am not aware of any place that you can change that so that the slug is just the date in the body of the message.
Jerry http://www.crminnovation.comWednesday, April 21, 2010 9:55 PM -
Turns out my main issue was that CRM won't create the actual letters during the workflow, only an activity to remind me to create the letters.
So now I just use mail merge when the activity comes due, and within mail merge I am able to insert "today's date" within Word, then I check the box to update the date automatically.
Thursday, April 22, 2010 9:30 PM -
Turns out my main issue was that CRM won't create the actual letters during the workflow, only an activity to remind me to create the letters.
So now I just use mail merge when the activity comes due, and within mail merge I am able to insert "today's date" within Word, then I check the box to update the date automatically.
Thursday, April 22, 2010 9:30 PM -
Brain,
This is the closest answer I could find to the issue I have. I woulld like to create a mail merge letter and in that I would like to include the attributes Annual Reevenu, SIC and some other custom attributes in the mail merge. I do not see all these fields in the selection window. I am working on CRM 4.0 roll up 14. Please help
Thanks
YM
Monday, January 10, 2011 11:40 PM -
After you click on the Word icon in the grid view a mail merge window opens up. in the section at the bottom there is a prompt to Select data fields. Use this button Data Fields to add the additional fields you need. But you need to mark them a searchable when you first created them.
Jerry http://www.crminnovation.comTuesday, January 11, 2011 2:15 AM