Hi Experts,
I am trying to create and post statements through x++ code.
Statement got created and it has updated 'Statement number' in RetailTransactionTable & RetailTransactionSalesTrans
Also all values are updated properly in RetailStatementTable.
However, the below code which is used to post statements is throwing an error "BOX API can't be used from non-interactive sessions"
RetailStoreOrderSynchronizer::CreateStoreSalesorders (statementTable.statementId, true);
The above line is the replica of native code which posts statements used in batch and also while posting statements manually.
Am I missing any of the setups etc.
Thanks.
N.Sridhar
*This post is locked for comments
Hi Martin,
Thank you very much.
Regards,
N.Sridhar
I see, it's in run() method of RetailStatementPost class.
Now you know why this happens. I see a few things your can do about it:
Hi Martin,
Below piece of code in RetailStatementPost is causing this error
if (!this.isInBatch())
{
if (operationProgress)
{
operationprogress.reset();
}
if (callerObject)
{
callerObject.activate(true);
}
Box::info("@RET4164");
}
In my case, we are not using either UI or running a batch to create and post statement. So by default system is considering that Box::info()
is getting executed from UI. I have either overlay of extend this class and respective method to fix the error.
Can you find out which line of code is throwing this error?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156