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

Announcements

No record found.

News and Announcements icon
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 while running custom report at the time of customer payment journal posting

(0) ShareShare
ReportReport
Posted on by 47

Hi All,

I am trying to open a customized report at the time of posting of customer payment journal but I am getting the error stack trace: cannot run form on non interactive session.

In another post they suggest to create extension of PurchFormLetterContract and use isprinting() method but I am not able to find the class and isprinting() method in case of customer payment journal posting.

Please help how this could be fix in case of Customer payment journal.

Thanks in Advance!!!

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

    Hi Parul Kaushik,

    It means you can't run a dialog in a non-interactive session.

    You need to fetch the record from the form using the prePromptModifyContract() method.

    Please check the CustPaymentJournalController class.

    pastedimage1600336790777v1.png

    You could try to put the following code before the next method by COC.

     if(this.parmArgs().dataset() == tableNum(CustPaymentJournalTmp))
            {
                CustPaymentJournalTmp custPaymentJournalTmp = this.parmArgs().record() as CustPaymentJournalTmp;
                contract.parmPurchId(CustPaymentJournalTmp.AccountRecId);
            }
      

  • Kaushik Parul Profile Picture
    47 on at

    Hi Will,

    I am trying with below code but still same error exist.

    [ExtensionOf(classStr(CustPaymentJournalController))]
    final class CustPaymentJournalController_TRI_Extension
    {
    protected void prePromptModifyContract()
    {
    CustPaymentJournalContract contract = this.parmReportContract().parmRdpContract();

    this.processReportParameters(contract);

    if (this.parmArgs().dataset() == tableNum(CustPaymentJournalTmp))
    {
    CustPaymentJournalTmp custPaymentJournalTmp = this.parmArgs().record() as CustPaymentJournalTmp;
    contract.parmLedgerJournalTransRecId(CustPaymentJournalTmp.AccountRecId);
    }

    next prePromptModifyContract();
    }

    }

    Please help.

  • Kaushik Parul Profile Picture
    47 on at

    Hi Will,

    Any suggestion??

    Thanks

  • WillWU Profile Picture
    22,363 on at

    Hi Kaushik,

    Please try to see the debug trace for the error code.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Parul,

    Is this a customized report?

    Could you please share your code on how you are calling the report at the end of payment journal posting?

  • Kaushik Parul Profile Picture
    47 on at

    Hi Gunjan,

    Below is the code snippet.

    [ExtensionOf(classStr(LedgerJournalCheckPost))]

    final class LedgerJournalCheckPost_TRI_Extension

    {

       /// <summary>

       ///

       /// </summary>

       /// <param name="args"></param>

       [PostHandlerFor(classStr(LedgerJournalCheckPost), methodStr(LedgerJournalCheckPost, run))]

       public static void LedgerJournalCheckPost_Post_run(XppPrePostArgs args)

       {

           LedgerJournalCheckPost  ledgerJournalCheckPost = args.getThis();

           LedgerJournalTable      ledgerJournalTable;

           LedgerJournalTrans      ledgerJournalTrans;

           ledgerJournalTable  = LedgerJournalTable::find(ledgerJournalCheckPost.parmJournalNum());

           if (ledgerJournalTable.JournalType == LedgerJournalType::CustPayment)

           {

               select firstonly ledgerJournalTrans

                   where ledgerJournalTrans.JournalNum == ledgerJournalTable.JournalNum;

               if (ledgerJournalTrans)

               {

                   args.record(ledgerJournalTrans);

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

                   menuFunction.run(args);

               }

           }

       }

    }

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Parul,

    Are you using a controller class for this report - TRICashReceiptReport? If so, please share the code on the main method as well.

  • Kaushik Parul Profile Picture
    47 on at

    Hi Gujan,

    Yes, I am using controller class.

    below is the snippet.

    class TRICashReceiptController extends SrsReportRunController

    {

       CustPaymentJournalContract  contract;

       LedgerJournalTrans          ledgerJournalTrans;

       public static TRICashReceiptController construct()

       {

           return new TRICashReceiptController();

       }

       public void prePromptModifyContract()

       {

           if (this.parmArgs() && this.parmArgs().record())

           {

               ledgerJournalTrans  = this.parmArgs().record();

               contract            = this.parmReportContract().parmRdpContract() as CustPaymentJournalContract;

               contract.parmLedgerJournalTransRecId(ledgerJournalTrans.RecId);

           }

       }

       public static void main(Args _args)

       {

           TRICashReceiptController    controller;

           controller = TRICashReceiptController::construct();

           controller.parmReportName(ssrsReportStr(CustPaymentJournalCopy, TriCustPaymentReport));

           controller.parmArgs(_args);

           controller.parmDialogCaption("Cash Receipt Report");

           controller.startOperation();

       }

    }

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Can you try this code in the main method and try ?

      public static void main(Args _args)
    {
       TRICashReceiptController    controller;
    
       controller = TRICashReceiptController::construct();
       controller.parmReportName(ssrsReportStr(CustPaymentJournalCopy, TriCustPaymentReport));
       controller.parmArgs(_args);
       controller.parmDialogCaption("Cash Receipt Report");
       controller.parmShowDialog(false);
       
       controller.startOperation();
    
    }

  • Kaushik Parul Profile Picture
    47 on at

    Hi Gunjan,

    I have already attached same code in main method above but no luck.

    public static void main(Args _args)

       {

           TRICashReceiptController    controller;

           controller = TRICashReceiptController::construct();

           controller.parmReportName(ssrsReportStr(CustPaymentJournalCopy, Tri_CustPaymentReport));

           controller.parmArgs(_args);

           controller.parmDialogCaption("Cash Receipt Report");

           controller.startOperation();

       }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 660

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 655 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans