Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // first retrieve the current opportunity record
- var opportunity = this.BindingSource.Current as Sage.Entity.Interfaces.IOpportunity;
- // now create the code to run the report
- // note, I am using placeholders like %MYVALUE% where I will inject the values from my opportunity entity
- var reportCode = @"
- var reporting = Sage.Services.getService('ReportingService');
- if (reporting) {
- var pluginId = reporting.getReportId('Opportunity:My Opportunity Report');
- reporting.setReportJob(pluginId, 'OPPORTUNITY', Sage.Utility.getCurrentEntityId());
- reporting.reportJob.rsf = '{OPPORTUNITY.OPPORTUNITYID} = ""' + Sage.Utility.getCurrentEntityId() + '"" and {OPPORTUNITY.SOMEFIELD} = ""%MYVALUE%""';
- reporting._showReport();
- }
- return false;
- ";
- // assign that javascript string to the button and ibject the values into the string as needed
- btnTest.OnClientClick = reportCode.Replace("%MYVALUE%", opportunity.SomeField);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement