locked
Plugin on Update Step not firing RRS feed

  • Question

  • Hi,

    I have written Plugin on a custom entity. I registered that on Update Step. But it is not firing. Can anyone help me out in this issue.

    Regards,

    Kishan.

    Monday, June 20, 2011 6:52 AM

Answers

All replies

  • Hello Kishan,

    Can you please post here step registration window from plugin registration tool and code of the plugin?


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter
    Monday, June 20, 2011 6:56 AM
    Moderator
  • Are you getting any error ??

    1. Have you signed your assembly ??

    2. Make sure your plugin class is public.

    also you can share your plugin code here.

     


    Mahain : My Dynamics CRM Blog
    Monday, June 20, 2011 6:56 AM
    Moderator
  • Hi,

    I created a custom entity and registered a plugin on update step, but it is not firing.

    When i register the plugin on create step it is firing.

    what may be the mstake.

    Regards,

    Kishan.


    Monday, June 20, 2011 7:04 AM
  • Step Registration:

    1. Message:   Update

    2. PrimaryEntity:   new_opp

    3. Pipeline stage for execution:   Post Stage

    4. Execution Mode:   synchronous

    5. Step Development: Online,Offline

    6. Triggering Pipeline: Parent Pipeline

     

    Here is the code

     

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.Crm.Sdk;
    using Microsoft.Crm.SdkTypeProxy;
    using System.Xml;
    using System.Data.SqlClient;
    using Microsoft.Crm.Sdk.Query;


    namespace OpprotunityStages
    {
        public class Opportunity_Stages : IPlugin
        {
            string Submissionstatus;
            public void Execute(IPluginExecutionContext context)
            {
                if (context.InputParameters.Contains("Target") && context.InputParameters.Properties["Target"] is DynamicEntity)
                {
                    DynamicEntity Entity = (DynamicEntity)context.InputParameters.Properties["Target"];

                    if (Entity.Properties.Contains("new_submisiionstatus"))
                    {
                        Picklist type = (Picklist)Entity["new_submissionstatus"];
                        Submissionstatus = type.Value.ToString();

                        if (Submissionstatus == "Submit")
                        {

                        }
                        else if (Submissionstatus == "Approve")
                        {

                        }
                        else if (Submissionstatus == "Reject")
                        {

                        }
                    }
                }
            }
        }
    }

     

    When i register the same plugin on create step it is working

    Monday, June 20, 2011 7:17 AM
  • 1.On change of what fields have you registered your plugin?

    2. Have you changed your submissionstatus field when you were testing your plugin?

    3. Submussionstatus variable for your case would never get the value like "Submit", "Approve", "Reject" because Submission status field (from your code) is a picklist and values can be 1, 2, 3...


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter
    Monday, June 20, 2011 7:21 AM
    Moderator
  • I am just testing it going to debugging mode.

    Its not even debugging.

    but when i registerd on create step it is debugging.

    What i want to check is

    1. i opened a record of the already created record of a custom entity. when i pressed save and close it is not firing.

    Monday, June 20, 2011 7:32 AM
  • Save will only execute, if it will find some property is changed, so if you are not changing anying in the form it won't fire.


    Mahain : My Dynamics CRM Blog
    Monday, June 20, 2011 7:51 AM
    Moderator