Hello everyone,
I'm encountering an error while trying to submit a purchase requisition workflow in Microsoft Dynamics AX 2012 R3. When I click on the submit button, I receive the following error message:
Microsoft Dynamics AX Debugger StackTrace: The company SysTransactionScopeCache does not exist. StackTrace (S)\Classes\SourceDocumentLineProcessor\submitSourceDocumentLineServer - line 66 (S)\Classes\SourceDocumentLineProcessor\submitSourceDocumentLine - line 51 (S)\Classes\SourceDocumentProcessor\submitSourceDocumentLinesForHeader - line 71 (S)\Classes\SourceDocumentProcessorFacade\submitSourceDocumentLinesForHeader - line 53 (S)\Classes\PurchReqWorkflow\validateAccountingDistributions - line 21 (C)\Classes\PurchReqWorkflow\canSubmit - line 36 (C)\Classes\PurchReqWorkflow\main - line 20 (C)\Classes\FormFunctionButtonControl\Clicked
Upon investigation, it seems that the [PurchReqLine table contains 4 rows, while the [SourceDcoumentLine table contains 5 rows. I suspect that the unlinked entry in the [SourceDcoumentLine table might be causing this issue. Can anyone provide guidance on how to remove the unlinked entry from the [SourceDcoumentLine table?
Here's the code block where the error occurs, specifically in line 68:
private static server void submitSourceDocumentLineServer( SourceDocumentLine _sourceDocumentLine, boolean _updateImplementation, SourceDocumentLineAccountingStatus _targetSourceDocumentLineAccountingStatus, SourceDocumentProcessorCaller _caller, UserId _user, AccountingDistributionAllocationMethod _accountingDistributionAllocationMethod, SourceDocumentLineItem _sourceDocumentLineItem = null, AccountingPolicy _sourceDocumentLineAccountingPolicy = null, boolean _isProcessForDocument = false, RecordInsertList _accountingDistributionInsertList = null, systemSequence _systemSequence = null, boolean _doTransitionToCompletedStateAccountFullyQualifiedValidation = true, RecordInsertList _sourceDocumentLineTmpInsertList = null ) { SourceDocumentLineProcessor sourceDocumentLineProcessor; SourceDocumentLineTargetStateProvider sourceDocumentLineTargetStateProvider; SourceDocumentLineItem sourceDocumentLineItem; // Flush cache for source document line item SysTransactionScopeCache::remove(classStr(SourceDocumentLineItem), [_sourceDocumentLine.RecId, _sourceDocumentLine.RecVersion]); if (_sourceDocumentLineItem) { sourceDocumentLineItem = _sourceDocumentLineItem; } else { sourceDocumentLineItem = SourceDocumentLineItem::newFromSourceDocumentLine(_sourceDocumentLine); } sourceDocumentLineItem.parmCaller(_caller); sourceDocumentLineTargetStateProvider = SourceDocumentLineTargetStateProvider::newTargetStateProvider( _sourceDocumentLine, _targetSourceDocumentLineAccountingStatus, false, _caller, _user, false ); sourceDocumentLineProcessor = SourceDocumentLineProcessor::newFromSourceDocumentLineImplementation( sourceDocumentLineItem.parmSourceDocumentLineImplementation(), _updateImplementation, sourceDocumentLineTargetStateProvider, _caller, _user, false, _accountingDistributionAllocationMethod, _sourceDocumentLine, sourceDocumentLineItem, _sourceDocumentLineAccountingPolicy); sourceDocumentLineProcessor.parmDoTransToCompletedStateAccountCheck(_doTransitionToCompletedStateAccountFullyQualifiedValidation); sourceDocumentLineProcessor.parmIsProcessForDocument(_isProcessForDocument); if (SourceDocumentLineProcessor::doSetBasedOperationOptimization(sourceDocumentLineItem)) { sourceDocumentLineProcessor.parmAccountingDistributionInsertList(_accountingDistributionInsertList); sourceDocumentLineProcessor.parmAccountingDistributionSystemSequence(_systemSequence); sourceDocumentLineProcessor.parmSourceDocumentLineTmpInsertList(_sourceDocumentLineTmpInsertList); } changecompany(CompanyInfo::getDataArea(sourceDocumentLineItem.parmLegalEntityRecId())) { sourceDocumentLineProcessor.submit(); <-------------- Error } }
I have taken the following steps to troubleshoot the issue, but unfortunately, they did not resolve the problem:
- Compilation
- Full CIL
- Synchronization
I would greatly appreciate any assistance or suggestions to resolve this problem.
Thank you in advance for your help!