Skip to content

Instantly share code, notes, and snippets.

@graut
Created September 27, 2016 11:18
Show Gist options
  • Save graut/817ceca23def21b0b38cdda03619974a to your computer and use it in GitHub Desktop.
Save graut/817ceca23def21b0b38cdda03619974a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
</head>
<body>
<h1>Create Company</h1>
<form name="create_contact_track">
<input type="button" value="Create Company in Agile CRM" onclick = "createCompany()">
</form>
<script type="text/javascript" src="https://Your_Domain.agilecrm.com/stats/min/agile-min.js"></script>
<script type="text/javascript" > _agile.set_account('youe_js_key', 'your_domain');
_agile.track_page_view();
_agile_execute_web_rules();
</script>
<script>
function createCompany() {
var company = {};
company.name = "abc inc";
company.phone = "+1-541-754-3010";
company.url = "http://www.abc-inc.com";
var address = {"city":"new delhi", "state":"delhi", "country":"india"};
company.address = JSON.stringify(address);
_agile.create_company(company, {
success: function (data) {
console.log(data);
console.log("success");
},
error: function (data) {
console.log(data);
console.log("error");
}
});
// Function end
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment