Created
February 24, 2016 17:14
-
-
Save tstachl/4932c66c10dd482b2d9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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