locked
Not able to add phonecall activity RRS feed

  • Question

  • Hi,

    I am trying to add phonecall activity for contact. I used following code to add activity, but I cannot see it in activity list.

               
                var ContactId = guid; //Contact GUID
    
                var trigger = new XrmServiceToolkit.Soap.BusinessEntity("phonecall");
                trigger.attributes["subject"] = "Hello";
                trigger.attributes["regardingobjectid"] =
                         { id: ContactId, logicalName: "Contact", type: "EntityReference" };
    
                triggerId = XrmServiceToolkit.Soap.Create(trigger);
        

    Kindly suggest if I am missing anything. 





    Monday, November 3, 2014 7:31 AM

Answers

  • Hi,

    Use logicalname: "contact" instead of logicalname: "Contact".

    trigger.attributes["regardingobjectid"] =
                         { id: ContactId, logicalName: "contact", type: "EntityReference" };


    Regards, Saad

    Monday, November 3, 2014 9:04 AM

All replies

  • Use this to get contactid:

    var ContactId = Xrm.Page.data.entity.getId();


    Regards, Saad

    Monday, November 3, 2014 7:50 AM
  • I cannot use this code because, I may not be at 'Contacts' page while adding information. I wanted to access from anywhere in dynamics crm.
    Monday, November 3, 2014 7:54 AM
  • How are you getting the contact GUID?

    Regards, Saad

    Monday, November 3, 2014 8:04 AM
  • We have somewhat typical business requirement. For that, I need to search Contact and that I am doing using OData. From OData I get guid of contact, and then I wanted to log (phonecall) activity for that particular guid. 

    I debugged, and I am getting correct guid.

    Monday, November 3, 2014 8:09 AM
  • Hi,

    Use logicalname: "contact" instead of logicalname: "Contact".

    trigger.attributes["regardingobjectid"] =
                         { id: ContactId, logicalName: "contact", type: "EntityReference" };


    Regards, Saad

    Monday, November 3, 2014 9:04 AM