[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/pabloperalta] Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4 - Pablo Peralta's Blog
Monday, August 23, 2010 12:57 PM pablop

Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/pabloperalta] 

Hi,

I have faced today with this issue in a Microsoft Dynamics CRM installation. Some workflows I were able to publish and some other weren't.

I just got the generic error: 'An error occurred when the workflow was being created. Try to save the workflow again'. No more usefil info in eventviewer.

 

Cause

After some reseach I found that this error may be caused if you applied some rollup or hotfix and the web.config file you have is not the default one, but has been manually modified (due to some ISV needs , for instance). This knwoledge base article talks about it.

In this case, the rollup / hotfix setup realizes that the web.config was manually modified and hence does not automatically update it to support rollup/hotfix changes.

Then, a manually update to web.config is needed.

 

Solution

As said above, I had to manually apply changes to web.config that should have been applied by hotfix/rollup setup but weren't because the file were manually manipulated.

The changes I applied were all within authorizedTypes section. In concrete, I added the following items to this section:

<authorizedTypes>

....

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" Authorized="True" />

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System" TypeName="Void" Authorized="True" />

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Reflection" TypeName="AssemblyFileVersionAttribute" Authorized="True" />

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Reflection" TypeName="AssemblyVersionAttribute" Authorized="True" />

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System" TypeName="Math" Authorized="True" /> <authorizedType Assembly="Microsoft.Crm.SdkTypeProxy, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Crm.SdkTypeProxy" TypeName="CrmService" Authorized="False" />

<authorizedType Assembly="Microsoft.Crm.SdkTypeProxy, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Crm.SdkTypeProxy.Metadata" TypeName="MetadataService" Authorized="False" />

....

</authorizedTypes>

 

After applying this, I opened one of the workflows that presented the problem and I could publish it successfully.

 

Hope this helps to somebody else,

PP

 

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/pabloperalta]

Filed under: ,

Comments

# re: Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4

Monday, October 04, 2010 10:41 PM by Ben

Thank you so much for the investigation you did around this the and resulting blog. You saved much wailing and swearing when my production deployment stalled.

# re: Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4

Tuesday, October 05, 2010 8:16 AM by pablop

My pleasure! Glad to know this was useful for you.

PP

# re: Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4

Sunday, October 10, 2010 7:59 PM by Leigh

I didn't hold out much hope of this fixing the problem but low and behold it did. Thanks heaps, CRM error messages are useless.

# re: Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4

Tuesday, January 04, 2011 6:55 AM by D. Lembcke

Thanks a lot for your post how to solve the problem. In my case the workflow coud not published when including the step "change status of opportunity into won". With your help I was able to fix the problem. Thank you again!

# re: Solving 'An error occurred when the workflow was being created. Try to save the workflow again' error while publishing workflows in Dynamics CRM 4

Thursday, March 24, 2011 9:30 AM by CRM_Noob

Thanks for the post - adding those lines to the web.config file worked great!

Leave a Comment

(required) 
(required) 
(optional)
(required)