Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NodeProxy Desk.com implementation
<script>
function callback() {
$.widget('desk.contact', $.ui.autocomplete, require('contact'));
$('.salesforce input').contact({
category: 'company',
username: 'username',
password: 'password',
clientId: 'SalesforceClientId',
clientSecret: 'SalesforceClientSecret',
mapping: {
'first_name': 'FirstName',
'last_name': 'LastName',
'company': 'Account.Name',
'title': 'Title',
'industry': 'Account.Industry'
}
});
}
(function(d, src, id, callback) {
if (d.getElementById(id)) return callback ? callback() : null;
var s, ref = d.getElementsByTagName('script')[0];
s = d.createElement('script'); s.id = id; s.async = true;
s.src = src; ref.parentNode.insertBefore(s, ref);
s.onload = s.onreadystatechange = function(e, isAbort) {
if (!isAbort && callback && (!s.readyState || /loaded|complete/.test(s.readyState)))
callback()
}
}(document, '//nodeproxy.herokuapp.com/assets/desk.js', 'salesforce-jssdk', callback));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.