Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Create Record Using Javascript Form Custom Button

$
0
0

I use crm 2016 on-premmis. I want to create a record by clicking the custom button using javascript. I create button using ribbon workbench. In the solution, i add jquery-1.9.1.js as a webresources. I write simple code, just to try if the custom button is work or not.

function createAccount() {
 startButton.attr("name");
 var account = {};
 account.Name = "Tes 001";
 account.Description = "Create Account Test";
 
 //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
   );
     
}


I call this function from custom button, but it seem doesn't work. Nothing happen when i click the custom button. Did i'm missing the requirements that make the function dont work ?


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>