title: Creating record using JS and JSON not correctly using owner value
body: <p>I'm attempt to create a record in Dynamics 365 using JavaScript however the Owner field is not being set properly.  The record creates just fine if I remove the setting of the 'ownerid' field. I have also tried formatting the guid both in lowercase and uppercase with no success (see comments in code).  The fields are displayed as expected in the alert.  </p>
  
  <p>When the script is run both with the code that makes the guid lowercase or not, I get the following error:</p>
  
  <blockquote>
    <p>Error: An error occurred while validating input paramters: Microsoft.OData.ODataException: A node of type 'StartArray' was read from the JSON reader when trying to read the contents of the property 'ownerid'; however, a 'StartObject' node or 'PrimitiveValue' node with null value was expected.</p>
  </blockquote>
  
  <pre><code>var managingDirector = Xrm.Page.getAttribute("new_managingdirector").getValue();
  
  var md_id = managingDirector[0].id;
  var md_name = managingDirector[0].name
  var md_entityType = "systemuser"
  
  //md_id = md_id.replace(/[{}]/g,"");
  //md_id = md_id.toLowerCase();
  //md_id = "{" + md_id + "}";
  
  if (managingDirector != null) {
      console.log(managingDirector[0]);
      alert("MD is " + md_name + " with id " + md_id + " and type " + md_entityType);
  } else {
      alert("MD is null");
  }
  
  var md_owner = new Array();
  md_owner[0] = new Object();
  md_owner[0].name = md_name;
  md_owner[0].id = md_id;
  md_owner[0].entityType = md_entityType;
  
  var data =
  {
      "new_name": "Sample Practice Management",
      "new_totalamountdue": amountDue,
      "new_deductions": deductionAmount,
      "new_deductionsnotes": deductionNotes,
       "ownerid": md_owner
  
  }    
  
  // create pm record
  Xrm.WebApi.createRecord("new_practicemanagement", data).then(
      function success(result) {
          alert("Practice Management record created with ID: " + result.id);
          // perform operations on record creation
      },
      function (error) {
          alert("Error: " + error.message);
          // handle error conditions
      }
  );
  </code></pre>
  
  <p>When I attempt to restructure the data variable like this (with both lowercase and uppercase ID)</p>
  
  <pre><code>var data =
  {
      "new_name": "Sample Practice Management",
      "new_totalamountdue": amountDue,
      "new_deductions": deductionAmount,
      "new_deductionsnotes": deductionNotes,
      "ownerid": {
          name: md_name,
          id: md_id,
          entityType: md_entityType
      }
  } 
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>An error occurred while validating input paramters: Microsoft.OData.ODataException: Does not support untyped vvalue in non-open type.</p>
  </blockquote>