web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Stack trace: Cannot run form on non interactive session error while opening SSRS Report in D365

(0) ShareShare
ReportReport
Posted on by 20

Hi All,

I have a custom report to print after product receipt is posted OK, there is a parameter to enable printing, if I printed together with the product receipt, it is printed OK. But if I want to print my custom report alone, then there is error : "Stack trace: Cannot run form on non interactive session".

Please help how it could be achieved.

Thanks

Somesh

I have the same question (0)
  • WillWU Profile Picture
    22,361 on at

    Hi Somesh Kumar Dubey,

    Have you read the old thread?

    community.dynamics.com/.../print-custom-report-after-product-receipt-post-successful-not-working

    pastedimage1600149958601v1.png

    You can try to use COC to extend the isPrinting() method to make it always return true.

  • Somesh Kumar Dubey Profile Picture
    20 on at

    Hi Will

    Thanks for response, can you please tell me how I can extend isPrinting() method and when do I need to call it excalty?

  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi,

    When you say, 'print my custom report alone' how are you calling the report? Can you share your existing code? Are you trying to run it in batch? The error typically comes when you are trying to open UI element(example dialog) in batch mode.

  • Verified answer
    WillWU Profile Picture
    22,361 on at

    Hi Somesh,

    Try the following codes:

    [ExtensionOf(classStr(PurchFormLetterContract))]
    final class PurchFormLetterContract_Extension
    {
        public boolean isPrinting()
        {
            next isPrinting();
            return true;
        }
    
    }

  • Somesh Kumar Dubey Profile Picture
    20 on at

    Hi Will,

    Thanks this is working as expected.

    I have a one more custom report to print after customer payment journal posting. But if I want to print my custom report, then there is same error : "Stack trace: Cannot run form on non interactive session".

    Please help how it could be achieved.

  • Somesh Kumar Dubey Profile Picture
    20 on at

    Hi Martin,

    Since you have locked my thread, Please help me with the customer journal posting report.

  • WillWU Profile Picture
    22,361 on at

    Hi Somesh Dubey,

    What problem are you encountering now, is it the same problem as your original thread? have you solved the issue?

  • Somesh Kumar Dubey Profile Picture
    20 on at

    Hi Will,

    I have one more custom report (CustomerPaymentJournalCopy) to print after customer payment journal posting. But if I want to print my custom report, then there is same error : Cannot run form on non interactive session".

    Please help how it could be achieved.

    Thanks in advance.

  • Kaushik Parul Profile Picture
    47 on at

    Hi Somesh,

    Have you read this thread??

    community.dynamics.com/.../stack-trace-cannot-run-form-on-non-interactive-session-while-running-custom-report-at-the-time-of-customer-payment-journal-posting

    Please try with below code on CoC.

    [ExtensionOf(formControlStr(LedgerJournalTransCustPaym, PostJournal))]

    final class LedgerJournalTransCustPaym_TRIForm_Extension

    {

      public void clicked()

      {

          MenuFunction                menuFunction;

          Args                        args;

          Tri_CashReportReportClass   controller;

          CustPaymentJournalContract  dataContract;

          LedgerJournalTrans          ledgerJournalTrans = this.dataSourceObject().cursor();

          next clicked();

          args = new Args();      

          args.record(ledgerJournalTrans);

          menuFunction = new MenuFunction(menuItemOutputStr(TRICashReceiptReport), MenuItemType::Output);

          menuFunction.run(args);

      }

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans