locked
Question regarding Workflow Assemblies and datatypes (CRM 4.0) RRS feed

  • Question

  •  

    Can a Workflow Assemblie only accept string parameters from CRM? I have made an assemblie that takes string and that works fine.

     

    Code Snippet

     public static DependencyProperty InputExampleProperty = DependencyProperty.Register("InputExample", typeof(string), typeof(Activity1));
     [CrmInput("InputExample")]
      public string InputExample {
       get { return (string) base.GetValue(InputExampleProperty); }
       set { base.SetValue(InputExampleProperty , value); } 
      }

     

     

    But if I try to pass a decimal value I get an error saying that decimal is not accepted.

    Code Snippet

      public static DependencyProperty AdjustmentfactorProperty = DependencyProperty.Register("Adjustmentfactor", typeof(decimal), typeof(Activity1));
      [CrmInput("Adjustmentfactor")]
      public decimal Adjustmentfactor
      {
       get { return (decimal)base.GetValue(AdjustmentfactorProperty); }
       set { base.SetValue(AdjustmentfactorProperty, value); }
      }

     

     

    So can I only pass strings to the assemblie and then change them from there into what I need?

    Wednesday, April 9, 2008 6:50 AM

Answers

  • Found this in the SDK:

     

     

     

    Code Snippet
    public static DependencyProperty myDecimalProperty = DependencyProperty.Register("myDecimal", typeof(CrmDecimal), typeof(Microsoft.Crm.QA.Workflow.DefaultValueTestActivity));

    [CrmInput("My Decimal")]
    [CrmOutput("My Decimal Output")]
    [CrmDefault("23.45")]
    public CrmDecimal myDecimal
    {
        get
        {
            return (CrmDecimal)base.GetValue(myDecimalProperty);
        }
        set
        {
            base.SetValue(myDecimalProperty, value);
        }
    }

     

     


    Guess the SDK holds many answers :-)

     

    Wednesday, April 9, 2008 9:41 AM