locked
Extract Month without specifying year in workflow RRS feed

  • Question

  • I have two custom fields on an entity Created On Month - Option Set, Created on Year. I would like these to be populated from the system created on date (for use with mutli - line charts).

    The problem is, when I create the workflow to set these fields, i have to select the full date

    If created on date is on or after January 1 but before Feb 1 set created on month to January. However, in this date field I have to choose a full date with year. 

    Tuesday, October 28, 2014 4:44 PM

Answers

  • And as an additional tip, add a picklist for your 12 month values and another workflow with 12 IF conditions to map the text values to your picklist values. It will be easier for you to then control the order in which your month columns appear on your chart. As a second tip, also parse the year value like with the month and you'll be able to create a chart with year-on-year columns!


    MCTS. GAP Consulting Ltd. Microsoft Community Contributor Award 2011 & 2013

    • Marked as answer by Nicole_CRM Wednesday, October 29, 2014 2:45 PM
    Tuesday, October 28, 2014 9:48 PM

All replies

  • OOB workflow won't return you datepart, so if you are looking for to get datepart only from created only date, you can write a custom workflow to use createdon date as input and return month part and year part as output and then you can use these output parameter to your custom fields.

    You can also check below codeplex utilities

    http://wfdatetimeutilities.codeplex.com/

    http://manipulationlibrary.codeplex.com/


    Microsoft Dynamics CRM Training|Our Blog | Follow US | Our Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, October 28, 2014 4:59 PM
    Moderator
  • or you could use the free workflow essentials solution that contains an updated version of the manipulation library http://www.gapconsulting.co.uk/our-solutions/free-tools/workflow-essentials

    We'll be making sure there's a crm2015 version available in time for the release.

    Rob


    MCTS. GAP Consulting Ltd. Microsoft Community Contributor Award 2011 & 2013

    Tuesday, October 28, 2014 7:56 PM
  • I imported the workflow essentials solution. How do I now extract the month and year to fill in the other fields?

    Tuesday, October 28, 2014 9:33 PM
  • Use 'DataFunctions.Dates.Parse Date'

    In the 'properties' of that custom step, populate it with your 'created on' date dynamically using the form assistant.

    Add an Update step beneath and in a text field, populate using the form assistant 'Set to' > Look For: Gap.Dates.ParseDate, then pick 'Month'.


    MCTS. GAP Consulting Ltd. Microsoft Community Contributor Award 2011 & 2013

    Tuesday, October 28, 2014 9:42 PM
  • And as an additional tip, add a picklist for your 12 month values and another workflow with 12 IF conditions to map the text values to your picklist values. It will be easier for you to then control the order in which your month columns appear on your chart. As a second tip, also parse the year value like with the month and you'll be able to create a chart with year-on-year columns!


    MCTS. GAP Consulting Ltd. Microsoft Community Contributor Award 2011 & 2013

    • Marked as answer by Nicole_CRM Wednesday, October 29, 2014 2:45 PM
    Tuesday, October 28, 2014 9:48 PM
  • Thanks, worked perfectly!
    Wednesday, October 29, 2014 2:46 PM