I recently had a javascript onclick event stop firing on my visualforce page. The strange thing is that there have not been any changes made to the page or the object related to the event.
Here is the page script:
<apex:includeScript value="https://service.apsona.com/sfdc/apsona_inline.min.js"/>
<script type="text/javascript">
// hack that prevents Salesforce from always putting focus
// on the first date field
window.onload = function() { }
// script to make sure Apsona has session ID
sforce.connection.sessionId = "{!$Api.Session_ID}";
// Test added 6/23/2016 by Sridhar, [email protected]
sforce.connection.serverUrl = UserContext.siteUrlPrefix + sforce.connection.serverUrl;
// For Apsona Merge Action (Cash Control Form link in VIP Attendees section) added by Michelle Regal @nimadmin on 6/27/2016
function callApsona(){
apsona.runAction ('buttonMerge', {
'element': this,
'actionId': 'a2OF0000002GRXhMAO',
'recordId': '{!Campaign.Id}',
'linkFieldId': 'Id'
});
}
</script>
And here is the code that calls the script:
<span onclick="callApsona();return false;" style="text-decoration:underline;">Cash Control Form</span>
When I click the text, the page refreshes, but nothing else happens. Here's the error that comes up when I use Chrome developer tools:
So it looks like the script to capture the Salesforce session ID isn't firing correctly. Any idea why this would suddenly stop working (on 3/9)?
apsona_inline.min.js
file has been updated?'apsona_key' of undefined
. 3. License of package not expired?