Infor CRM Web Client – Running a Report from a Button and Allowing Users to Choose the Output Format

In previous posts I had written about how to use javascript and the client side Infor report service to invoke a report from a button.

In this post I talked about the simplest way which just runs the report for the current entity and saves it as a PDF.

In this post I talked about how using a different service call allows for custom record selection criteria to be added, rather than the single primary ID being passed in by the first link.

Using that second option gives us another possibility, allowing the user to define what kind of output they want.

To do this we can modify our call to the setReportJob and instead of calling showReport, we instead create a options object, passing in our parameters and then call startWizard, passing in our options object. In our custom options object we simply pass into the wizardOptions just to hide step 1, rather than the defaul of hiding step 1 and 3 (the output type).

Here is a complete sample:

        var oReporting = Sage.Services.getService('ReportingService');
        if (oReporting) {
            var pluginId = oReporting.getReportId('Opportunity:Opportunity Detail');
            oReporting.setReportJob(pluginId, 'OPPORTUNITY', Sage.Utility.getCurrentEntityId());            
            var contextSvc = Sage.Services.getService('ClientEntityContext');
            var context = contextSvc.getContext();
            var entityId = context.EntityId;
            oReporting.reportJob.rsf = "{OPPORTUNITY.OPPORTUNITYID} = 'Q1RASA501HGU' or {OPPORTUNITY.DESCRIPTION} = 'Winner Winner Chicken Dinner' ";
                        
            var options = {
                reportId: pluginId,
                reportOptions: {
                    wizardOptions: {
                        hiddenSteps: [1]
                    },
                    scheduleOptions: {
                        executionType: 0
                    },                    
                    conditionOptions: {
                        conditionsConnector: 'And',
                        recordSelectionFormula: oReporting.reportJob.rsf
                    }
                }
            };
            oReporting.startWizard(options);
ABOUT THE AUTHOR

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!