I have a button in a Skuid Opportunity overlay that is not working. When pressed, nothing happens at all, not even an error message. Any idea why this might be happening? I and my team are stuck!
Button Type: Run Skuid Snippet
Snippet Properties:
Resource location: In-Line (Snippet)
Snippet Body:
var $ = skuid.$; var opp = skuid.model.getModel("Opportunity").getFirstRow();
var o = new sforce.SObject("Opportunity");
o.Id = opp.Id; var contactId = sforce.connection.query("SELECT ID FROM Contact WHERE Name LIKE '%" + opp.Installer_Salesperson_Text__c + "%' AND AccountId = '" + opp.AccountId + "'"); if (contactId.getArray("records")[0] === null || contactId.getArray("records")[0] === '' || contactId.getArray("records")[0] === undefined) {
alert('We were not able to find a contact record for the Salesperson contact on this opportunity. To login as user, please go to their contact page.');
} else {
var result = sforce.apex.execute('GhostingUtil','login',{partnerConId:contactId.getArray("records")[0].Id});
if (result.includes('ERROR: ')) {
alert(result);
} else {
window.open(result,'_blank');
}
}