<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jonas Deibe - Dynamics CRM, C#, JS : WorkFlow</title><link>http://blogs.msdn.com/jonasd/archive/tags/WorkFlow/default.aspx</link><description>Tags: WorkFlow</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Creating a no-code workflow for CRM 4.0 with Visual Studio 2005 (2008)</title><link>http://blogs.msdn.com/jonasd/archive/2008/01/21/Creating-a-no_2D00_code-workflow-for-CRM-4.0-with-Visual-Studio-2005-_2800_2008_2900_.aspx</link><pubDate>Mon, 21 Jan 2008 23:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7188263</guid><dc:creator>Jonas Deibe</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/jonasd/comments/7188263.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jonasd/commentrss.aspx?PostID=7188263</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;New in CRM 4.0 is the possibility to build custom workflows using Windows Workflow Foundation (WF).&amp;nbsp;WF is the programming model, engine and tools for quickly building workflow enabled applications on CRM 4.0. In previous version of CRM the engine was limited and not as robust. WF is&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt; a standard component used in many other products (MOSS, Biztalk ect). &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Business rule example&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;-when an Opportunity is created a check is done and if estimated value is greater than 100000 a task is created and associated to the opportunity. Schedule end date is set to same as opportunity estimated close date. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;No rocket science and just an example...&amp;nbsp;I would like to see an example of integration with&amp;nbsp;MOSS or other document library. Once I'm back from my parental leave and I have the time I might&amp;nbsp;publish something.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;/SPAN&gt;
&lt;P&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;IMG title="Workflow from VS2005sp1" style="WIDTH: 345px; HEIGHT: 480px" height=480 alt="Workflow from VS2005sp1" src="http://blogs.msdn.com/photos/jonadeimicrosoftcom/images/7188026/345x480.aspx" width=345 mce_src="http://blogs.msdn.com/photos/jonadeimicrosoftcom/images/7188026/345x480.aspx"&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 7.5pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;Flow from Visual Studio 2005 sp1.&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;In the workflow policy (TaskValues)&amp;nbsp;I set the values for my reminder task and this is the only code needed.&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;this&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;.ReminderTask = Microsoft.Crm.Workflow.&lt;SPAN style="COLOR: #2b91af"&gt;CrmWorkflow&lt;/SPAN&gt;.CreateEntity(&lt;SPAN style="COLOR: #a31515"&gt;"task"&lt;/SPAN&gt;)&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ReminderTask[&lt;SPAN style="COLOR: #a31515"&gt;"subject"&lt;/SPAN&gt;] = &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;.Concat(&lt;SPAN style="COLOR: #a31515"&gt;"Please follow Up on Opportunity "&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.PostImageOpportunity[&lt;SPAN style="COLOR: #a31515"&gt;"name"&lt;/SPAN&gt;])&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ReminderTask[&lt;SPAN style="COLOR: #a31515"&gt;"scheduledend"&lt;/SPAN&gt;] = &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.PostImageOpportunity[&lt;SPAN style="COLOR: #a31515"&gt;"estimatedclosedate"&lt;/SPAN&gt;]&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ReminderTask[&lt;SPAN style="COLOR: #a31515"&gt;"description"&lt;/SPAN&gt;] = &lt;/FONT&gt;&lt;SPAN style="COLOR: #a31515"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;"Automatic Task generated from Workflow. Please add your own notes here."&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;this&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;.OpportunityId = Microsoft.Crm.SdkTypeProxy.&lt;SPAN style="COLOR: #2b91af"&gt;CrmTypes&lt;/SPAN&gt;.CreateLookup(Microsoft.Crm.SdkTypeProxy.&lt;SPAN style="COLOR: #2b91af"&gt;EntityName&lt;/SPAN&gt;.opportunity.ToString(),&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Context.PrimaryEntityId)&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.ReminderTask[&lt;SPAN style="COLOR: #a31515"&gt;"regardingobjectid"&lt;/SPAN&gt;] = &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.OpportunityId&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;U&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;The final result&amp;nbsp;on my Opportunity&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;IMG title="Opportunity workflow runned" style="WIDTH: 640px; HEIGHT: 388px" height=388 alt="Opportunity workflow runned" src="http://blogs.msdn.com/photos/jonadeimicrosoftcom/images/7188383/640x388.aspx" width=640 mce_src="http://blogs.msdn.com/photos/jonadeimicrosoftcom/images/7188383/640x388.aspx"&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;FONT size=1&gt;Click on the Activites I would see my "reminder task". &lt;BR&gt;NOTE! Since the default view is on next 30days you need to change the view to "all" else you won't see you task.&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;U&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Links related to subject&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Windows Workflow Foundation on MSDN&lt;BR&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa663328.aspx"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://msdn2.microsoft.com/en-us/netframework/aa663328.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;o:p&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Dynamics on MSDN&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/sv-se/dynamics/default(en-us).aspx"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://msdn2.microsoft.com/sv-se/dynamics/default(en-us).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;SharePoint Server 2007 SDK: Software Development Kit&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=6D94E307-67D9-41AC-B2D6-0074D6286FA9&amp;amp;displaylang=en"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://www.microsoft.com/downloads/details.aspx?familyid=6D94E307-67D9-41AC-B2D6-0074D6286FA9&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Windows SharePoint Services 3.0: Software Development Kit (SDK)&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=19F21E5E-B715-4F0C-B959-8C6DCBDC1057&amp;amp;displaylang=en"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://www.microsoft.com/downloads/details.aspx?familyid=19F21E5E-B715-4F0C-B959-8C6DCBDC1057&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;VS 2005 extensions for .NET 3.0&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=5D61409E-1FA3-48CF-8023-E8F38E709BA6&amp;amp;displaylang=en"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://www.microsoft.com/downloads/details.aspx?familyid=5D61409E-1FA3-48CF-8023-E8F38E709BA6&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Microsoft .NET Framework 3.0 Redistributable Package&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=10CC340B-F857-4A14-83F5-25634C3BF043&amp;amp;displaylang=en"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://www.microsoft.com/downloads/details.aspx?familyid=10CC340B-F857-4A14-83F5-25634C3BF043&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation)&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023-E8F38E709BA6&amp;amp;displaylang=en"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023-E8F38E709BA6&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;Microsoft Virtual Labs&lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://netfx3.com/labs/"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;http://netfx3.com/labs/&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;The Visual Studio project is attached below and for instructions how-to publish the workflow please see the CRM 4.0 SDK.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-ansi-language: EN-US"&gt;&lt;FONT face=tahoma,arial,helvetica,sans-serif&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7188263" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/jonasd/attachment/7188263.ashx" length="331170" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/jonasd/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/jonasd/archive/tags/English/default.aspx">English</category><category domain="http://blogs.msdn.com/jonasd/archive/tags/CRM+4.0/default.aspx">CRM 4.0</category><category domain="http://blogs.msdn.com/jonasd/archive/tags/WorkFlow/default.aspx">WorkFlow</category></item></channel></rss>