Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Custom scripts error - the run test fail

(1) ShareShare
ReportReport
Posted on by 2

Hello,

I'm trying my first custom script, but I'm getting this error that doesn't exist in the documentation: The custom script is not allowed to access the AccountingEventSourceDocumentLineLink table. Based on the logs, it appears that the script was executed successfully, but failed for some reason. Any ideas? 

I try to reverse the reception of a command, the script is executed successfully in the development environment and I test it as administrator in the UAT.

Find bellow part of the script execution log

[5/30/2023 02:52:47 pm] Database activity:
Table AccountingDistribution is accessed 2 times using a Read operation.
Table AccountingDistribution is accessed 1 times using a UpdateRecordSet operation.
Table AccountingDistributionEventTmp is accessed 1 times using a InsertRecordSet operation.
Table AccountingDistributionTmpForValidation is accessed 1 times using a InsertRecordSet operation.
Table AccountingDistributionTmpJournalize is accessed 1 times using a InsertRecordSet operation.
Table AccountingDistributionTmpJournalize is accessed 1 times using a Read operation.
Table AccountingEvent is accessed 2 times using a Read operation.
Table AccountingEvent is accessed 1 times using a Update operation.
Table AccountingEventDateTmp is accessed 1 times using a InsertRecordSet operation.
Table AccountingEventSourceDocumentLineLink is accessed 1 times using a InsertRecordSet operation.
Table AccountingEventTmp is accessed 1 times using a Create operation.
Table AccountingEventTmp is accessed 1 times using a InsertRecordSet operation.
Table DimensionAttributeLevelValue is accessed 1 times using a Read operation.
Table DimensionAttributeLevelValueView is accessed 2 times using a Read operation.
Table DimensionAttributeValueGroupCombination is accessed 1 times using a Read operation.
Table DimensionAttributeValueSetItem is accessed 3 times using a Read operation.
Table FiscalCalendarPeriod is accessed 39 times using a Read operation.
Table FormletterParmTable is accessed 2 times using a Read operation.
Table InventBatch is accessed 1 times using a Update operation.
Table InventSumDelta is accessed 1 times using a Create operation.
Table InventSumDelta is accessed 2 times using a Update operation.
Table InventTrans is accessed 2 times using a Create operation.
Table InventTrans is accessed 4 times using a Read operation.
Table InventTrans is accessed 3 times using a Update operation.
Table InventTransOrigin is accessed 3 times using a Read operation.
Table InventTransPosting is accessed 2 times using a Create operation.
Table LogisticsPostalAddress is accessed 7 times using a ReadFromCache operation.
Table MarkupTrans is accessed 1 times using a Read operation.
Table NumberSequenceDatatypeParameterType is accessed 3 times using a Read operation.
Table NumberSequenceList is accessed 2 times using a Read operation.
Table NumberSequenceList is accessed 2 times using a Update operation.
Table NumberSequenceTable is accessed 3 times using a ReadFromCache operation.
Table NumberSequenceTable is accessed 1 times using a Update operation.
Table NumberSequenceTTS is accessed 1 times using a Create operation.
Table PdsVendBatchInfo is accessed 1 times using a Update operation.
Table PurchLine is accessed 1 times using a DoUpdate operation.
Table PurchLine is accessed 1 times using a Read operation.
Table PurchLine is accessed 1 times using a Update operation.
Table PurchParmLine is accessed 1 times using a Update operation.
Table PurchParmLine is accessed 1 times using a UpdateRecordSet operation.
Table PurchParmSubTable is accessed 1 times using a DoUpdate operation.
Table PurchParmTable is accessed 1 times using a Update operation.
Table PurchParmUpdate is accessed 1 times using a Update operation.
Table PurchTable is accessed 1 times using a DoUpdate operation.
Table SourceDocumentHeader is accessed 1 times using a Update operation.
Table SourceDocumentLine is accessed 2 times using a Read operation.
Table SourceDocumentLine is accessed 1 times using a Update operation.
Table SourceDocumentLine is accessed 1 times using a UpdateRecordSet operation.
Table SourceDocumentLineItemTmp is accessed 1 times using a Create operation.
Table SourceDocumentLineRecIdTmp is accessed 1 times using a InsertRecordSet operation.
Table SourceDocumentLineTmpJournalize is accessed 1 times using a InsertRecordSet operation.
Table SourceDocumentLineTmpJournalize is accessed 1 times using a Read operation.
Table SubledgerJournalAccountEntry is accessed 1 times using a InsertRecordSet operation.
Table SubledgerJournalAccountEntry is accessed 4 times using a Read operation.
Table SubledgerJournalAccountEntry is accessed 1 times using a UpdateRecordSet operation.
Table SubledgerJournalAccountEntryDistribution is accessed 1 times using a InsertRecordSet operation.
Table SubledgerJournalAccountEntryDistribution is accessed 1 times using a UpdateRecordSet operation.
Table SubledgerJournalAccountEntryTmpClearing is accessed 1 times using a InsertRecordSet operation.
Table SubledgerJournalAccountEntryTmpDetail is accessed 1 times using a DeleteRecordSet operation.
Table SubledgerJournalAccountEntryTmpDetail is accessed 2 times using a InsertRecordSet operation.
Table SubledgerJournalAccountEntryTmpDetail is accessed 2 times using a Read operation.
Table SubledgerJournalAccountEntryTmpDetail is accessed 1 times using a UpdateRecordSet operation.
Table SubledgerJournalAccountEntryTmpForValidation is accessed 1 times using a InsertRecordSet operation.
Table SubledgerJournalAccountEntryTmpSummary is accessed 2 times using a InsertRecordSet operation.
Table SubledgerJournalAccountEntryTmpSummary is accessed 2 times using a Read operation.
Table SubledgerJournalEntry is accessed 1 times using a Create operation.
Table SubledgerJournalEntry is accessed 2 times using a Read operation.
Table SysCacheFlush is accessed 1 times using a Update operation.
Table TaxData is accessed 1 times using a Read operation.
Table TaxUncommitted is accessed 4 times using a Read operation.
Table TaxWorkRegulation is accessed 1 times using a DeleteRecordSet operation.
Table TmpTax is accessed 1 times using a Create operation.
Table TmpTax is accessed 1 times using a Read operation.
Table TmpTax is accessed 1 times using a Update operation.
Table TmpTaxWorkTrans is accessed 1 times using a Create operation.
Table TmpTaxWorkTrans is accessed 1 times using a DoUpdate operation.
Table TmpTaxWorkTrans is accessed 5 times using a Read operation.
Table TmpTaxWorkTrans is accessed 1 times using a Update operation.
Table TmpTaxWorkTrans is accessed 1 times using a UpdateRecordSet operation.
Table TransactionLog is accessed 1 times using a Create operation.
Table VendDocumentSubTableMap is accessed 1 times using a DeleteRecordSet operation.
Table VendDocumentTableMap is accessed 1 times using a DeleteRecordSet operation.
Table VendPackingSlipJour is accessed 1 times using a Create operation.
Table VendPackingSlipJour is accessed 1 times using a ReadFromCache operation.
Table VendPackingSlipJour_Intrastat is accessed 1 times using a Create operation.
Table VendPackingSlipTrans is accessed 1 times using a Create operation.
Table VendPackingSlipTrans is accessed 1 times using a Read operation.
Table VendPackingSlipTrans_Intrastat is accessed 1 times using a Create operation.
Table VendPackingSlipVersion is accessed 1 times using a Create operation.
Table VendPackingSlipVersion is accessed 1 times using a ReadFromCache operation.
[5/30/2023 02:52:47 pm] Infolog:
Purchase order PO-00055511 reception reversed
The custom script is not allowed to access the AccountingEventSourceDocumentLineLink table.
[5/30/2023 02:52:47 pm] Completed

  • Suggested answer
    Lauras U Profile Picture
    Lauras U 955 on at
    Custom scripts error - the run test fail
    I had similar issue with updating NumberSequenceTable. Turns out that for some tables (tablegroup=Framework OR SystemTable=Yes) it needs special flighting enabled. 
    Special flighting: AppConsistencyCustomScriptAllow%YOUR_TABLE_NAME%
    See this for details:
  • Suggested answer
    Lauras U Profile Picture
    Lauras U 955 on at
    Custom scripts error - the run test fail
    Got similar error.
    Uppon debugging it turned out, that System tables or tables with TableGroup::Framework updates is restricted. NumberSequenceTable table group is Framewoek. Can have a an exception by enabling AppConsistencyCustomScriptAllowNumberSequenceTable flight.
     
    More details here.
  • AT-22040756-0 Profile Picture
    AT-22040756-0 2 on at
    RE: Custom scripts error - the run test fail

    Hi André, please find below the code I am trying to execute. Can you help me understand the login behind the protection please? Is there any Microsoft documentation or link? And what are the limitations?

    Models included are : 

    • Application Common

    • ApplicationFoundation

    • ApplicationPlatform

    • Application Suite

    • Directory

    • FiscalBooks

    • SourceDocumentation

    • SourceDocumentation Types

    • SubLedger
    • Tax

        public static void main(Args _args)

        {

            PurchLine                   purchLine;

            PurchFormLetter             purchFormLetter;

            PurchFormletterParmData     purchFormLetterParmData;

            PurchParmUpdate             purchParmUpdate;

            PurchParmTable              purchParmTable;

            PurchParmLine               purchParmLine;

            PurchTable                  purchTable;

            PurchId                     purchId;

            Num                         packingSlipId;

            LineNum                     lineNum;

            PurchQty                    correctedQty;

            ;

            purchId         = 'PO-00055511';

            packingSlipId   = 'FAS-000103-1';

            lineNum         = 1;

            correctedQty    = -1;

            changecompany('CAN')

            {

                ttsBegin;

                // Create PurchParamUpdate table

                purchTable      = PurchTable::find(purchId, true);

                purchFormLetterParmData = PurchFormletterParmData::newData(DocumentStatus::PackingSlip, VersioningUpdateType::Initial);

                purchFormLetterParmData.parmOnlyCreateParmUpdate(true);

                purchFormLetterParmData.createData(false);

                purchParmUpdate = purchFormLetterParmData.parmParmUpdate();

                // Set PurchParmTable table

                purchParmTable.clear();

                purchParmTable.TransDate                = str2Date('04/01/2023', 213);

                purchParmTable.Ordering                 = DocumentStatus::PackingSlip;

                purchParmTable.ParmJobStatus            = ParmJobStatus::Waiting;

                purchParmTable.Num                      = packingSlipId;

                purchParmTable.PurchId                  = purchTable.PurchId;

                purchParmTable.PurchName                = purchTable.PurchName;

                purchParmTable.DeliveryName             = purchTable.DeliveryName;

                purchParmTable.DeliveryPostalAddress    = purchTable.DeliveryPostalAddress;

                purchParmTable.OrderAccount             = purchTable.OrderAccount;

                purchParmTable.CurrencyCode             = purchTable.CurrencyCode;

                purchParmTable.InvoiceAccount           = purchTable.InvoiceAccount;

                purchParmTable.ParmId                   = purchParmUpdate.ParmId;

                purchParmTable.insert();

                // Set PurchParmLine table

                select firstonly purchLine

                    where purchLine.PurchId == purchTable.purchId && purchLine.LineNumber == lineNum;

                if(purchLine)

                {

                    purchParmLine.InitFromPurchLine(purchLine);

                    purchParmLine.ReceiveNow    = correctedQty;

                    purchParmLine.ParmId        = purchParmTable.ParmId;

                    purchParmLine.TableRefId    = purchParmTable.TableRefId;

                    purchParmLine.setQty(DocumentStatus::PackingSlip, false, true);

                    purchParmLine.setLineAmount();

                    purchParmLine.insert();

                }

                purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);

                purchFormLetter.transDate(str2Date('04/01/2023', 213));

                purchFormLetter.proforma(false);

                purchFormLetter.specQty(PurchUpdate::ReceiveNow);

                purchFormLetter.purchTable(purchTable);

                purchFormLetter.parmParmTableNum(purchParmTable.ParmId);

                purchFormLetter.parmId(purchParmTable.ParmId);

                purchFormLetter.purchParmUpdate(purchFormLetterParmData.parmParmUpdate());

                purchFormLetter.run();

                ttsCommit;

            }

            info(strFmt('%1 updated',purchId));

        }

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,642 Super User 2024 Season 2 on at
    RE: Custom scripts error - the run test fail

    Hi,

    Execution of custom scripts works different than running a class with the class runner object. Some tables are restricted and some operations are being blocked for consistency/protection reasons.

    Can you share the x++ coding for the script you used? Please use the richt formatting and then Insert > Code where you can paste coding.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans