locked
using iOrganizationService to create a case RRS feed

  • Question

  • I have a web page that successfully creates an Account and a Contact. But I have not been successful at creating a new case.

    Dim incident As New Entity("incident")

    Dim newCaseID As Guid = service.Create(incident)

    Service.Create(incident) returns an error:  Incorrect value type System.String

    Tuesday, December 23, 2014 10:31 PM

Answers

  • Hi,
    You have to provide customer when you crate a new Case as it is a required field.
    It can be either a Contact or an Account.

    I have given the C# code below.

    		Entity incident = new Entity("incident");
                    //If the customer is a Contact
                    incident["customerid"] = new EntityReference("contact", new Guid("your guid here"));
                    //or if it is an Account use below line.
                    //incident["customerid"] = new EntityReference("account", new Guid("your guid here"));
                    Guid newCaseid = Proxy.Create(incident);

    Thanks.


    Sachith Chandrasiri

    Tuesday, December 23, 2014 11:05 PM