title: How to update only the StatusCode of an entity in MS CRM Dynamics 2013
body: <p>I'm trying to update a Quote status code in MS CRM 2013 via the SDK. The issue is that I <strong>only</strong> need to update the status code and not the state code in the quote. The current State of the quote is Active and the current Status value is 10 (which I need to update to 11). I've tried a few things unsuccessfully so far:</p>
  
  <ul>
  <li>Using the Microsoft.Crm.Sdk.Messages.SetStateRequest(), setting only the Status property:</li>
  </ul>
  
  <pre class="lang-cs prettyprint-override"><code>    var request = new SetStateRequest
      {
          EntityMoniker = new EntityReference("quote", quoteId),
          Status = new OptionSetValue(11)
      };
  
      var resp = (SetStateResponse) orgService.Execute(request);
  
      // throws Exception Microsoft.Xrm.Sdk.OrganizationServiceFault:
      // "Required field 'State' is missing"
  </code></pre>
  
  <ul>
  <li>Using the <code>Microsoft.Crm.Sdk.Messages.SetStateRequest()</code>, setting both Status and the State property (setting the new State to the same current value):</li>
  </ul>
  
  <pre class="lang-cs prettyprint-override"><code>    var request = new SetStateRequest
      {
          EntityMoniker = new EntityReference("quote", quoteId),
          State = new OptionSetValue((int) QuoteState.Active),
          Status = new OptionSetValue(11)
      };
  
      var resp = (SetStateResponse) orgService.Execute(request);
  
      // throws Exception Microsoft.Xrm.Sdk.OrganizationServiceFault:
      // "The quote cannot be activated because it is not in draft state."
  </code></pre>
  
  <ul>
  <li><p>Calling the Update method (passing in a quote instance) in the <code>Microsoft.Xrm.Sdk.Client.OrganizationServiceContext</code> class. I don't have the exact code I used when I tried this, but the error I was getting was:</p>
  
  <blockquote>
    <p>"The object cannot be updated because it is read-only."</p>
  </blockquote>
  
  <p>I made sure the connection was made using admin user credentials, but it didn't make a difference. I also found a few other posts like this one: <a href="https://stackoverflow.com/questions/1237152/dynamics-crm-error-the-object-cannot-be-updated-because-it-is-read-only">read-only entity error</a> but that didn't help either.</p></li>
  </ul>
  
  <p><strong>Question</strong></p>
  
  <p>Is there a way to programmatically update the Quote status code without altering the state code? If so, how?</p>