-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
#code
`function createContact() {
var email_received = document.getElementById('email').value;
var contact = {};
contact.email = email_received;
contact.first_name = document.getElementById('f_name').value;
contact.last_name = document.getElementById('l_name').value;
contact.company = "abc corp";
contact.title = "lead";
contact.phone = "+1-541-754-3010";
contact.website = "http://www.example.com";
var address = {"city": "new delhi", "state": "delhi", "country": "india"};
contact.address = JSON.stringify(address);
contact.tags = "tag1, tag2";
// Custom fields can be added to contact object as
contact.status = "incomplete";
contact.custom_id = "EN001C";
_agile.create_contact(contact, {
success: function (data) {
// Set Email at success of contact creation. But you can set it at failure too.
_agile.set_email(email_received);
console.log("CONTACT success");
var deal = {};
deal.name = "Test Deal";
deal.description = "This is a test deal";
deal.expected_value = "10000";
deal.milestone = "Target";
deal.probability = "95";
deal.close_date = "1514160000"; // Epoch time
_agile.add_deal(deal, {
success: function (data) {
console.log("success");
},
error: function (data) {
console.log("error");
}
});
},
error: function (data) {
console.log("error");
console.log("Error Cause = "+data);
}
});
// Function end
}`
Metadata
Metadata
Assignees
Labels
No labels