Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Elite Contributor
Posts: 39
Registered: ‎04-14-2009

Launch Custom report from Button

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;
        }
    });
}

 

Employee
Posts: 629
Registered: ‎04-24-2009

Re: Launch Custom report from Button

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