Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Unable to register custom workflow using plugin registration tool,The type Int32 of the property is not supported in CRM 4.0.

$
0
0

I have created a model property in my custom workflow code, generated assembly of the code. I have then tired registering of the assembly file usingplug-in registration tool but at the end of completion getting an error message like below- The type Int32 of the property model is not supported. (Is plug-in registration tool supports 64-bit int type, if then how to change the int32 to int64 from the code I have pasted in bottom)

Unhandled Exception: System.Web.Services.Protocols.SoapException: Server was unable to process request.
Detail: <detail><error>
  <code>0x8004501d</code>
  <description>The type Int32 of the property model is not supported.</description>
  <type>Platform</type>
</error></detail>
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at PluginRegistrationTool.CrmSdk.CrmService.Create(BusinessEntity entity)
   at PluginRegistrationTool.RegistrationHelper.RegisterPluginType(CrmOrganization org, CrmPlugin plugin)
   at PluginRegistrationTool.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)

Please refer my code below and correct me if I did something wrong.

[CrmWorkflowActivity("Create Cardetails Record", "Utilities")]
    public partial class CreateCardetails : SequenceActivity
    {
        public static DependencyProperty modelProperty = DependencyProperty.Register("model", typeof(int), typeof(CreateCardetails));

        [CrmInput("Model")]
        public int model
        {

            get
            {
                return (int)base.GetValue(modelProperty);
            }

            set
            {
                base.SetValue(modelProperty, value);
            }

        }

        public CreateCardetails()
        {

            InitializeComponent();

        }

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {

            // Get the context service.
            IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
            IWorkflowContext context = contextService.Context;

            // Use the context service to create an instance of CrmService.
            ICrmService crmService = context.CreateCrmService(true);

            DynamicEntity entity = null;
            Guid contactId;

            if (context.InputParameters.Properties.Contains("Target") && context.InputParameters.Properties["Target"] is DynamicEntity)
            {
                // Obtain the target business entity from the input parmameters.
                entity = (DynamicEntity)context.InputParameters.Properties["Target"];
                contactId = ((Key)entity.Properties["contactid"]).Value;

                Lookup lookup = new Lookup();
                lookup.Value = contactId;
                lookup.type = "contact";

                //Create an account which is linked to the contact record
                DynamicEntity cardetails = new DynamicEntity("cir_cardetails");

                cardetails["cir_carsdetailsid"] = lookup;

                //Setting the picklist value of Model
                Picklist modelPickList = new Picklist();
                modelPickList.Value = (int)model;
                cardetails.Properties.Add(new PicklistProperty("cir_model", modelPickList));
                Guid carkey = crmService.Create(cardetails);
                 
            }
            return ActivityExecutionStatus.Closed;
        }
    }

Kindly help, my all lucks are now gone. I have no idea how to fix it and even not sure about the issue.




Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>