views:

33

answers:

1

I was just wondering if anyone knew the number of days that Dynamics CRM defines as 1 month when it comes to work flows.

I am currently developing a workflow that requires some date checking and need to verify something at the 150 day mark.

Thanks in advance!

A: 

Behind the scenes, the Dynamic Values picker in the Workflow builder saves to a CrmTimeSpan type. When a CrmTimeSpan/TimeSpan is used, months are stored as months, not a sum of days. For example:

DateTime firstOfTheYear = new DateTime(2010, 1, 1);

CrmTimeSpan timespan = CrmTimeSpan.CreateCrmTimeSpan(0,1,0,0,0);

DateTime firstDayOfFebruary = timespan.Add(firstOfTheYear);

DateTime firstDayOfMarch = timespan.Add(firstDayOfFebruary);

Because you need to check against a date range that isn't supported by the picker, here is a custom workflow activity that should get you on the right track.

Forgotten Semicolon