Hi guys,
faced weird issue in AX 2012.
I have a customization on posting advance invoice.
Once invoice has been posted successfully following method is run from customization (some debug info lines are added for tracing purposes):
void printJournal() { Args args = new Args(); ReportRun reportRun; ; if (xSession::isCLRSession()) { info('Running in a CLR session.'); } else { info('Running in an interpreter session.'); if (isRunningOnServer()) { info('Running on the AOS.'); } else { info('Running on the Client.'); } } args.record(custInvoiceJourPrint); args.caller(this); new MenuFunction(menuitemOutputStr(FreeTextInvoiceOriginal), MenuItemType::Output).run(args); }
This code is being called from class running on Server SalesInvoiceJournalPost (it is set in standard as runOn = Server).
When logic is run in p-code interpreter session code works well. Report is rendered on the screen and sale invoice itself posted correctly (report is not a SSRS report but old MorphX report).
But if "Execution in CIL" option is enabled, sales invoice is not posted and following line throw exception:
new MenuFunction(menuitemOutputStr(FreeTextInvoiceOriginal), MenuItemType::Output).run(args);
Exception is caught by block in FormLetterService class:
catch { // exceptionTextFallThrough(); code = WinAPIServer::getLastError(); info(strFmt("error code - %1, ", code)); }
It says that Error code is = 0;
Full CIL has been generated successfully, AOS restsrted and I deleted all old caches as well but no luck.
I tried to debug it in VS, all symbols have been loaded and code is the same as in p-code version but result is the same. No information about sort or CLR error.
I enabled all exceptions in VS and caught following:
Additional information:
Das Socket wurde abgebrochen, da ein asynchroner Empfangsvorgang vom Socket nicht innerhalb des zugewiesenen Zeitlimits von 00:02:00
In English: The socket was abortedbecause an asynchronous receive operation from the socket failed within the allotted timeout.
Any ideas would be much appreciated. Many thanks!