locked
Custom Calculation Workflow Assembly RRS feed

  • Question

  • Hi,

     

    I have created the following code to perform a calculation. Built the solution & copied the dll into the assembly file.

     

    when i go to register the assembly i get error message No plugins have been selected from the list. Please select at least one & try again.

     

    same message occurs when i select the assembly & try again.

     

    i noticed a difference between my solution & Stunnware's ExportProductInformationActivity solution at the same registration point in that it has a workflow activity under the assembly which is automatically ticked.

     

    below is my attempt at the code, maybe i am missing something

     

    thanks in advance for assistance

     

    using System;
    using System.ComponentModel;
    using System.ComponentModel.Design;
    using System.Collections;
    using System.Drawing;
    using System.Workflow.ComponentModel.Compiler;
    using System.Workflow.ComponentModel.Serialization;
    using System.Workflow.ComponentModel;
    using System.Workflow.ComponentModel.Design;
    using System.Workflow.Runtime;
    using System.Workflow.Activities;
    using System.Workflow.Activities.Rules;

    namespace CalculateTotalCost
    {
     public partial class CalculateTotal: SequenceActivity
     {
      public CalculateTotal()
      {
       InitializeComponent();
      }
            public string retStr(string str)
            {
                return str.ToUpper();
            }
            public float getTotal1(int new_number, int new_frequency)
            {
                float dTemp;
                dTemp = (((float)new_number * (float)2.15) * (float)new_frequency) + (float)new_frequency * (float)2.20;
                return dTemp;
            }
     }
    }

    Sunday, March 30, 2008 12:22 PM

All replies

  • i added the following & have now successfully registered the assembly which appears in my workflow

     

    using Microsoft.Crm.Sdk;
    using Microsoft.Crm.SdkTypeProxy;
    using Microsoft.Crm.Workflow;

     

    and

     

        [CrmWorkflowActivity("Calculate Lead Total", "My Custom Workflow Activities")]

     

    when i insert the workflow & go to set properties in the form assistant the following is selected

    Dynamic Values

    Operator is blank

    Look for Lead

     

    when i click on the box below the dropdown is blank...

     

    (I was going to select the total cost field)

     

    Thanks in advance

    Sunday, March 30, 2008 12:38 PM
  • any assistance would be greatfully appreciated

     

    i would of though that all i had to do was add GetTotal1 into the Total Cost field.

     

    thanks in advance

    Tuesday, April 1, 2008 9:59 AM
  • anybody

     

    i have had another look through the sdk & cant seem to find anything

    Wednesday, April 2, 2008 10:44 AM
  • You'll need to add a DependencyProperty. The most recent version of the CRM 4 SDK has some information on this. Search for "Attributes and Microsoft Dynamics CRM Types"

     

    Wednesday, April 2, 2008 7:16 PM
    Moderator
  • thanks David

    Wednesday, April 2, 2008 8:18 PM
  • Check Microsoft Dynamics Types,  dependency etc

     

    Regards,

    Imran

     

     

    Monday, April 7, 2008 11:33 AM
    Moderator
  • thanks Imran

    Tuesday, April 8, 2008 5:05 AM
  • What type would the value field be in a picklist in crm 4?

     

    thanks

    Tuesday, April 8, 2008 5:53 AM
  • Hello David,

     

    Ive had a look in the sdk but am really unsure where to put this peice of code.

     

    This is my attempt at it.

     

    Any chnace of having a quick look over  

     

    Thanks in advance

     

    Code Snippet

    using System;
    using System.ComponentModel;
    using System.ComponentModel.Design;
    using System.Collections;
    using System.Drawing;
    using System.Workflow.ComponentModel.Compiler;
    using System.Workflow.ComponentModel.Serialization;
    using System.Workflow.ComponentModel;
    using System.Workflow.ComponentModel.Design;
    using System.Workflow.Runtime;
    using System.Workflow.Activities;
    using System.Workflow.Activities.Rules;
    using Microsoft.Crm.Sdk;
    using Microsoft.Crm.SdkTypeProxy;
    using Microsoft.Crm.Workflow;

    namespace CalculateTotalCost
    {
        [CrmWorkflowActivity("Calculate Lead Total", "My Custom Workflow Activities")]
        public partial class CalculateTotal: SequenceActivity
     {
      public CalculateTotal()
      {
       InitializeComponent();
      }
            public string retStr(string str)
            {
                return str.ToUpper();
            }
            public static DependencyProperty myFloatProperty = DependencyProperty.Register("GetTotal1", typeof(CrmFloat), typeof(Microsoft.Crm.QA.Workflow.NoOpActivity));
            [CrmInput("GetTotal1 Input")]
            [CrmOutput("GetTotal1 Output")]
            public CrmFloat GetTotal1
            {
                get
                {
                    return (CrmFloat)base.GetValue(myFloatProperty);
                }
                set
                {
                    base.SetValue(myFloatProperty, value);
                }
            }
            //public float getTotal1(int new_number, int new_frequency)
            //{
            //    float dTemp;
            //    dTemp = (((float)new_number * (float)2.15) * (float)new_frequency) + (float)new_frequency * (float)2.20;
            //    return dTemp;
            //}
     }
    }

     

    Tuesday, April 8, 2008 10:09 AM