locked
CRM 2001: Using CRM 4.0 Workflow-Assembly with Metadata RRS feed

  • Question

  • Hi,

     

    I am currently facing a big issue with CRM 4.0 Workflow-Assemblies that are used in CRM 2011.

     

    It occurs when trying to access status or state attribute metadata options.

    Part of the code:

        StateAttributeMetadata stateAttributeMetadata = (StateAttributeMetadata)GetAttributeMetadata(StateCodeAttributeName);<br/>   StateOption stateOption = (StateOption)(stateAttributeMetadata.Options[(int)dataRow[StateCodeAttributeName]]); 
    


    Retrieving the metadata does not fail with an exception - however the Options collection is empty.

     

    This only happens when this code runs in either a plugin or a workflow. Using this code from a console application it works fine.

     

    Has anybody a similar issue and hopefully a solution?

     

    Thanks,

    Jens

     

    PS: We also checked the soap traffic and when executing the workflow the service returns the options fine.

    Friday, July 8, 2011 1:49 PM

Answers

  • Hi,

     

    it looks like there is no solution for this except to upgrade the code to CRM 2011 code - which we've done.

     

    Thanks,

    Jens

    • Marked as answer by Jens.Voigt Thursday, November 17, 2011 9:59 AM
    Thursday, November 17, 2011 9:59 AM

All replies

  • Hi,

    Check if workflow owner User account has approproate priveleges or try running it via System Administrator account.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Friday, July 8, 2011 2:01 PM
  • Hi,

    this is unfortunately already the case.

     

    It looks like the deserialization of the response to the StateAttributeMetadata fails. Or the legacy conversion is buggy.

    We sniffed the network traffic from our server running the async service and the web application server and the reponse really contains all options of the StateCodeMetadata - however they are empty within the workflow code.

     

    Thanks,

    Jens

    Monday, July 11, 2011 7:43 AM
  • Hi,

     

    it looks like there is no solution for this except to upgrade the code to CRM 2011 code - which we've done.

     

    Thanks,

    Jens

    • Marked as answer by Jens.Voigt Thursday, November 17, 2011 9:59 AM
    Thursday, November 17, 2011 9:59 AM