locked
how to create loged on user cases RRS feed

  • Question

  • how to create loged on user cases please help me i can retrive each case details but i

    can create cases please help me

    Wednesday, September 9, 2015 11:08 AM

All replies

  • Hi,

    To create a case record from c# refer: http://ekoncis.blogspot.in/2012/01/crm-2011-create-new-case-incident-using.html

    Entity incident = new Entity("incident");
    incident["title"] = "Case subject";
    
    // Set customerid with some existing contact guid 
    Guid customerid = new Guid("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}");
    
    // Set customerid as contact to field "customerid" 
    EntityReference CustomerId = new EntityReference("contact", customerid);
    incident["customerid"] = CustomerId;
    
    // Set contactid with some existing contact guid 
    Guid contactid = new Guid("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}");
    
    // Set contactid as contact to field "casecontactid" 
    EntityReference primaryContactId = new EntityReference("contact", contactid);
    incident["casecontactid"] = primaryContactId;
    
    _service.Create(incident);
    

    • Proposed as answer by Piyush Parate Thursday, September 10, 2015 8:04 AM
    Wednesday, September 9, 2015 2:48 PM