Stack trace: The company SysTransactionScopeCache does not exist.

Hi there,

I am experiencing this error "Stack trace: The company SysTransactionScopeCache does not exist." when I try to submit a purchase requisition.

Does anyone know what causes this error?

It sounds like that there is a bug trying to use ‘SysTransactionScopeCache’ as a company. Look at the code in question to understand what’s going on. If you need help from us, please share the call stack and the code. If you can’t/don’t know how, ask a developer (if you have a development team) or your implementation partner.

Hi Martin,

This is the stack trace found in the infolog:

Stack trace

(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

This could help, unfortunately I don’t have any AX 2012 environment on hand. Hopefully I’ll be able to take a look tomorrow.
If you’re a developer, use the debugger to see understand what’s happening in code.

Thanks, Martin.
While hoping for your insights by tomorrow, I will try debugging this error.

Can you also show your code in,
\Classes\SourceDocumentLineProcessor\submitSourceDocumentLineServer - line 66

Here Kranthi, the line highlighted in yellow is the 66th line of the code…


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();

}

}

It seems that CompanyInfo::getDataArea() returns ‘SysTransactionScopeCache’ for some reason. Use the debugger to see why.

I looked into the code but there is nothing I can do without being able to reproduce your problem. Please use the debugger to debug it in your environment.