03-05-2014 04:46 AM
Has anybody been successful at getting a custom report to launch from a button ?
ive tried the following code on the client click event without success so far (adpated from Here )
It gets as far as showing "show Report Support Ticket xxxxxx" but goes no further.
This is on v8.0 with Web Update 6/Core update 4 and all current LAN upates
var contextSvc = Sage.Services.getService('ClientEntityContext'); var context = contextSvc.getContext(); var TicketId = context.EntityId; alert('Ticket Id: ' + TicketId); showReport('Support Ticket', TicketId); function showReport(ReportName, TicketId) { alert('show Report ' + ReportName + ' ' + TicketId); require(['Sage/Reporting/Service'], function(Service) { var oReporting = Sage.Services.getService('ReportingService'); if (oReporting) { alert('before report'); oReporting.showReport(ReportName, 'TICKET', TicketId); alert('after report'); return true; } else { alert('Reporting Service not available'); return false; } }); }
03-06-2014 08:34 AM
Hi,
Based on your debug code, it appears that the call to require(['Sage/Reporting/Service'], function(Service) {} must be failing for some reason. Instead of using alert() I'd use console.log...since alert() can sometimes interfere will stuff.
Questions:
1. Do you see anything in the console regarding the loading of the reporting service?
2. What browser and version are you using?
3. What OS are you using?
4. Did replacing alert() with console.log help?
Thanks
Mike