locked
CRM 4.0 Plugins with CRM Service RRS feed

  • Question

  • Hi All ,

    I am New to Plugins in my scenerio i need to retrieve a custom attribute from phone call entity when a phone call closes and based on the retrieved attribute value i want to update campaign Response entity

    every thing is working fine in my plugin except i was not able to retrieve the custom attribute , I have tried using Pre Images, Target Retrieve but i couldn't get it so I tried CRM service WebService now it is working fine I want to know weather it would crerate any Problems in Futher. Is there any alternate way to get the custom attribute

     

    Thanks in Advance

    Saturday, April 23, 2011 1:08 PM

Answers

  • Performing the retrieve within the plugin won't cause any problems. I would suggest that you try and avoid using AllColumns() instead define a columnset with just the columns that you need.
    Wednesday, May 4, 2011 3:47 PM

All replies

  • Sunday, April 24, 2011 1:28 AM
    Moderator
  • sorry i cant understand what are you asking

    looking in the sense scenario ?

     

    I want to update Contact Entity -->Custom attribute(Contact_status) based on the phone call Entity --> Custom attribute(Phone call_status) , I created custom views based on the selection the record will be displayed in one view to the other (i.e. if the user click phone call status 1 and complete the phone call it will in turn change the status in the contact ,so that the record will be displayed in different views )

     

     

     

    Sunday, April 24, 2011 1:26 PM
  • You said everything is working fine inside your plugin except one thing.  It might help someone reading this tread diagnose if you post your plugin code.
    Jamie Miley
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!
    Sunday, April 24, 2011 2:42 PM
    Moderator
  • Hi  Jamie ,

     

    my Plugin code

     

    if

    (context.PrimaryEntityName == EntityName.phonecall.ToString() && context.InputParameters.Properties.Contains("EntityMoniker") && context.InputParameters.Properties.Contains("State"))

    {

     

    // I will get the current Phone call Id and its state

     

     

    Guid PhoneCallId = ((Moniker)context.InputParameters.Properties["EntityMoniker"]).Id;

    PhoneCallState stateCode = (PhoneCallState)

    Enum.Parse(typeof(PhoneCallState), ((string)context.InputParameters.Properties["State"]));

     

    // Only update the regarding account s field , if the phone call is completed
     

     

    if (stateCode == PhoneCallState.Completed)

    {

    ICrmService service = context.CreateCrmService(

    false);

    phonecall myphonecall = (phonecall)service.Retrieve(EntityName.phonecall.ToString(),

    PhoneCallId,

    new AllColumns());

     

    string regardingType = myphonecall.regardingobjectid.type;

     

    Guid regardingId = myphonecall.regardingobjectid.Value;

    Retrieve Callstatus =

    new Retrieve();

    StatusName = Callstatus.Retrival(PhoneCallId.ToString());

      

    and Am using a separate Retrieve.cs file and Am creating a object for that file called  "call status" and using that i am  calling the method called Retrieval(phone-call Id as parameter) were i have used crm web-services for retrieval of custom attributes

     

     

    I have tried Target retrieve option and preImage options

     

    Friday, April 29, 2011 1:38 PM
  • Performing the retrieve within the plugin won't cause any problems. I would suggest that you try and avoid using AllColumns() instead define a columnset with just the columns that you need.
    Wednesday, May 4, 2011 3:47 PM
  • Thursday, May 17, 2012 6:56 PM
    Moderator
  • Hi, how to find the number of activites added to a particular account? i am writing a plugin for finding the number of activities added to a account. i,e total number of appointment/activities to be summed up and shown in a custom attribute in account. Very very Urgent

    Sai Krishna Yadav Software Engineer..

    Thursday, June 21, 2012 5:49 AM