web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Issue with Submitting Purchase Requisition Workflow

(0) ShareShare
ReportReport
Posted on by 130

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:

  1. Compilation
  2. Full CIL
  3. Synchronization

I would greatly appreciate any assistance or suggestions to resolve this problem.

Thank you in advance for your help!

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans