Run Aras Report from Method

Good day all,

How do I run an Aras report from a Method?  I have several reports that I have created in Aras (not MS Report Services) and I can't figure out how to run one from a method.  I'm trying to create a Modal Dialog so the use can pick the report and information needed, then run the report.  I noticed that there is an applyMethod (and others), but it didn't seem to work when I tried applyReport (I was hoping it would be that simple).  Thank you for any help you can provide.

  • Hi Nathan,

    I found this masterpiece in my valuable collection of fine arts that I have built up over the years:

    var qry = new Item('Part','get');
    qry.setID('DEAE331032E2495DA9C9BBB6CA4583EE'); //Id of the context item

    var reportQry = new Item('Report','get');
    reportQry.setID('FB8CA61BE45E46DE9E4346BB653398C2'); //Id of the Report -> Multilevel_BOM
    var report = reportQry.apply();

    aras.runReport(report.node, '', qry.node);

    The code is from 2017, so maybe it requires some update to current codestyle.

    But you can also look at the Aras-Methods that trigger Report items, e.g. Method 'cui_ivicb_reports_click' . This Method shows a more flexible variant, that can also call Self-Service-Reports.

  • Angela,

    Thanks for this info.  I was able to get this report to run with what I am trying to do.  Now I need to get the report I want to run to work.

    Edit - I know, only a couple of minutes later, but...  I was able to get this to work the way I wanted by removing the var qry & qry.setID lines and changing the qry.node to ''.  Thanks again for your awesome help!

    var reportQry = new Item('Report','get');
    reportQry.setID('9812FBDFDDD64EF5B0799CCE7A55B73E'); //Id of the Report -> My Custom Report
    var report = reportQry.apply();

    aras.runReport(report.node, '', '');