locked
What plugin step to be added to update a record on Re-Assign owner - CRM 2011 RRS feed

  • Question

  • Hi Techies,

    What is the step i should register to update on Re-Assigning owner.

    Here is my requirement, On creation of contact we are creating a related custom entity record priority. Now on changing or Reassigning the owner of Contact , i want to change the owner of related priority record.

    I have tried adding a plugin step with assign, But it is not firing the plugin.

    Any suggestions.


    Sreeni Pavalla

    Thursday, January 24, 2013 4:36 AM

Answers

  • Hi Sreeni,

    I gone through the Sdk Messages and Entity supported documentation (copied below) .As per documentation "Assign" is available for Contact and should fire Plugin. My suggestion for Route was misleading. 

    Can you please share your code.

    Message Name Primary Entity
    Assign Account
    Assign Annotation
    Assign Appointment
    Assign Campaign
    Assign CampaignActivity
    Assign CampaignResponse
    Assign Connection
    Assign Contact
    Assign Contract
    Assign CustomerOpportunityRole
    Assign CustomerRelationship
    Assign Email
    Assign Fax
    Assign Goal
    Assign GoalRollupQuery
    Assign Incident
    Assign IncidentResolution
    Assign Invoice
    Assign Lead
    Assign Letter
    Assign List
    Assign new_customentity
    Assign Opportunity
    Assign OpportunityClose
    Assign OrderClose
    Assign PhoneCall
    Assign ProcessSession
    Assign Queue
    Assign Quote
    Assign QuoteClose
    Assign RecurringAppointmentMaster
    Assign SalesOrder
    Assign ServiceAppointment
    Assign SharePointDocumentLocation
    Assign SharePointSite
    Assign Task
    Assign Template
    Assign UserForm
    Assign UserQuery
    Assign UserQueryVisualization
    Route Appointment
    Route CampaignActivity
    Route CampaignResponse
    Route Email
    Route Fax
    Route Incident
    Route Letter
    Route PhoneCall
    Route RecurringAppointmentMaster
    Route ServiceAppointment
    Route Task


    If my response answered your question, please mark the response as an answer and also vote as helpful !!! - Krantikumar

    Friday, January 25, 2013 10:58 AM

All replies

  • Hi Sreeni,

    An Assign can be done using one of two messages: Assign or Route. The CRM Web application issues a Route message to do an assign. You should register your plug-in in the parent pipeline for both messages. So please try by using these both messages.        

    Thanks,

    Krantikumar                           

    Thursday, January 24, 2013 5:41 AM
  • Hi Kranti,

    I have created Message as "Assign" and tried assigning record to some one else. But the plugin is not at all getting fired.

    We cannot use Route message for Contact record. 

    Thank you,



    Sreeni Pavalla


    Thursday, January 24, 2013 2:05 PM
  • Any other suggestions ?

    Sreeni Pavalla

    Friday, January 25, 2013 9:24 AM
  • True, Route is not the supported message for Contact Entity. Assign do works. Please check below sample code.

    // Create the Request Object and Set the Request Object's Properties
    AssignRequest assign = new AssignRequest
        {
            Assignee = new EntityReference(SystemUser.EntityLogicalName,
                _otherUserId),
            Target = new EntityReference(Account.EntityLogicalName,
                _accountId)
        };
    
    
    // Execute the Request
    _service.Execute(assign);
    

    Friday, January 25, 2013 10:00 AM
  • Hi Joshi,

    I donot have any problem to re-assign the owner progrmatically. I am using the bewlo code

     public void ReassignOwner(Guid OwnerID, Guid TargetOwnerID, string EntityName, IOrganizationService service)
            {

                AssignRequest assign = new AssignRequest
                {
                    Assignee = new EntityReference(SystemUser.EntityLogicalName,
                        OwnerID),
                    Target = new EntityReference(EntityName,
                        TargetOwnerID)
                };
                _service.Execute(assign);
            }

    The problem here is that, When i re-assign the owner from UI, the plug in step which is created on Assign on Update of Contact is not getting initiated.

    So which step do i need to create for this?


    Sreeni Pavalla

    Friday, January 25, 2013 10:51 AM
  • Hi Sreeni,

    I gone through the Sdk Messages and Entity supported documentation (copied below) .As per documentation "Assign" is available for Contact and should fire Plugin. My suggestion for Route was misleading. 

    Can you please share your code.

    Message Name Primary Entity
    Assign Account
    Assign Annotation
    Assign Appointment
    Assign Campaign
    Assign CampaignActivity
    Assign CampaignResponse
    Assign Connection
    Assign Contact
    Assign Contract
    Assign CustomerOpportunityRole
    Assign CustomerRelationship
    Assign Email
    Assign Fax
    Assign Goal
    Assign GoalRollupQuery
    Assign Incident
    Assign IncidentResolution
    Assign Invoice
    Assign Lead
    Assign Letter
    Assign List
    Assign new_customentity
    Assign Opportunity
    Assign OpportunityClose
    Assign OrderClose
    Assign PhoneCall
    Assign ProcessSession
    Assign Queue
    Assign Quote
    Assign QuoteClose
    Assign RecurringAppointmentMaster
    Assign SalesOrder
    Assign ServiceAppointment
    Assign SharePointDocumentLocation
    Assign SharePointSite
    Assign Task
    Assign Template
    Assign UserForm
    Assign UserQuery
    Assign UserQueryVisualization
    Route Appointment
    Route CampaignActivity
    Route CampaignResponse
    Route Email
    Route Fax
    Route Incident
    Route Letter
    Route PhoneCall
    Route RecurringAppointmentMaster
    Route ServiceAppointment
    Route Task


    If my response answered your question, please mark the response as an answer and also vote as helpful !!! - Krantikumar

    Friday, January 25, 2013 10:58 AM