title: Javascript Create and Update Record In Dynamics CRM from Custom Button
body: <p>I have a requirement to create and update some records from custom button. This custom button placed on homepage of the contact. First, i need to check one or more contact. Once the custom button is clicked, its creating an account in account entity then update look up field of the contact that i checked before with account that we create. </p>
  
  <p>I am trying the step inside this <a href="http://www.zacrmguy.com/js-crud-operations-with-web-api-in-crm-2016/#comment-447" rel="nofollow">link</a> and <a href="https://lakshmanindian.wordpress.com/2012/11/29/update-selected-records-in-home-page-entity-grid-in-crm-2011/" rel="nofollow">this</a>, but it's seem doesn't work for Dynamics CRM 2016 on-premis</p>
  
  <p>Could you please help me and give me a suggestion or another documentary that you think it can satisfy my requirement above.</p>
  
  <p><strong>EDITED</strong>:
  on the sdk, there is an example to use JQueryRestDataOperation. From there, i write a code like this: </p>
  
  <pre><code>    function createAccount() {
  
   startButton.attr("name");
  
   var account = {};
  
   account.Name = "Test Account Name";
  
   account.Description = "This account was created by the JQueryRESTDataOperations sample.";
  
  
  
   //Create the Account
  
   SDK.JQuery.createRecord(
  
       account,
  
       "account",
  
       function (account) {
  
        writeMessage("The account named "" + account.Name + "" was created with the AccountId : "" + account.AccountId + "".");
  
        writeMessage("Retrieving account with the AccountId: "" + account.AccountId + "".");
  
        retrieveAccount(account.AccountId)
  
       },
  
       errorHandler
  
     );
  
  
  
  }
  </code></pre>
  
  <p>I add this code as webresource in my solution, then call it from custom button. But nothing happen. </p>
  
  <p>Thanks</p>