Skip to main content

Notifications

Finance forum
Answered

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

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 227,971 Super User 2024 Season 2 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,645 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
    sohaibcheema Profile Picture
    sohaibcheema 46,594 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.

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,115 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,971 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans