Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created February 24, 2016 17:14
Show Gist options
  • Save tstachl/4932c66c10dd482b2d9e to your computer and use it in GitHub Desktop.
Save tstachl/4932c66c10dd482b2d9e to your computer and use it in GitHub Desktop.
desk.ready(function() {
desk.interaction.ajax('/api/v2/customers/search?email=tstachl%40salesforce.com', {
method: 'GET',
callback: function(data) {
if (data.status === 200 && data.payload.total_entries > 0) {
var customer = data.payload.entries.first;
desk.interaction.screenPop(customer.id, 'object=customer', function(response) {
if (response.result) {
alert('screenPop successful.');
} else {
alert('screenPop failed. ' + response.error.message);
}
});
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment