Skip to main content

Notifications

Announcements

No record found.

Finance forum

"BOX API can't be used from non-interactive sessions" error when performing settlements via a batch job

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey everyone,

I am trying to settle customer and vendor transactions (payments/invoices) via a batch job. From what I have noticed the batch job seems to be working fine during vendor transactions settlement, but during customer transactions settlement this error shows up randomly "BOX API can't be used from non-interactive sessions".

The confusing thing is this was working fine before (for both customer and vendor transactions) but now seems to be working only for vendor and not for customer transactions. Does anyone have any information regarding this particular error or what might be causing this during settlement via batch jobs?

EDIT 1:
From what I can see from the trace, the error seems to be popping up in CustOpenVendTransManager::updateTransMarked().
I am further trying to pinpoint from where the error is thrown and will update the post accordingly.

EDIT 2:
The method is calling a box message in code line mentioned below. The error is most probably popping up due to the Box::yesNo() method. I will be further debugging the whole process to ensure that's the case and will fix it accordingly.
Thank you sohaibcheema and Sukrut Parab for answering and pointing me in the right direction.

if (skipPrePaymentSettlementWarning || !custVendTrans.Prepayment || Box::yesNo("@SYS68879", DialogButton::No) == DialogButton::Yes)]


  • Martin Dráb Profile Picture
    Martin Dráb 230,371 Most Valuable Professional on at
    "BOX API can't be used from non-interactive sessions" error when performing settlements via a batch job
    Mårten, can you please explain how it's related to Box API in non-interactive sessions? It sounds like a completely different topic to me, therefore I believe you should create a new thread for your question.
  • "BOX API can't be used from non-interactive sessions" error when performing settlements via a batch job
    Hi,
     
    Connected to this issue we wanted to reverse our journal and the system did not allow any other method than through batch due to size of journal, please advise.
  • Verified answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,671 Moderator on at
    RE: "BOX API can't be used from non-interactive sessions" error when performing settlements via a batch job

    When untry to settle transactions , there is some box message (I don't remember exactly now ) pops up from the static method u mentiined. If you want to avoid it ,just duplicate the method ,remove box message and use it in your batch code.

  • Verified answer
    Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: "BOX API can't be used from non-interactive sessions" error when performing settlements via a batch job

    In general error message is asking you for about use of BOX::AnyFunctions (which should be avoided ins such cases)

    Because BoxAPI prompts the users for things such as “Please choose Yes/NO”

    If things are being run in batch mode, this should be avoided as it could be a non-interactive session, what if batch job is running in the night. Watch the code where it’s using BOX API code and consider replacement for those areas.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans