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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

The custom script is not allowed to access the XYZ table

(1) ShareShare
ReportReport
Posted on by 634
Hi Experts,
 
I am getting below error while trying to run a custom script. can anyone help me to solve it please.
 
 
I am trying to update the BankTransAmountCur value for a record in the table bankAccountTrans using below class
 
class UAPBankTransUpdate
{
  
    public static void main(Args _args)
    {
        BankAccountTrans    bankAccountTrans;
        if(curExt() != 'UAP')
        {
            throw error("This script must run in UAP entity");
        }
        select forupdate bankAccountTrans
            where bankAccountTrans.RecId == 5637187458;
        if(bankAccountTrans)
        {
            ttsbegin;
            bankAccountTrans.BankTransAmountCur = 258000.33654;
            bankAccountTrans.doUpdate();
            Info("Record updated");
            ttscommit;
        }

    }
}
 
 
 
I have the same question (0)
  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,
     
    What are the roles that are assigned to the user who was running the script? Is it admin?
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Anton Venter Profile Picture
    20,345 Super User 2025 Season 2 on at
    Hello,
     
    Please explayin why are you updating this bank transaction? If you update the amount of this transaction, you will create a difference that cannot be accounted for.
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at
    Hi,
     
    Several transaction tables are restricted to be used to make changes via custom scripts. The method name raising the error already indicates this. It is checking for supported tables. So, you can't use this table in a custom script. 

    As asked by others, what is the business reason for updating an amount directly in a posted transaction?
  • D365  beginner Profile Picture
    634 on at
    Thank you all for the response.
     
    I am having system administrator role. What happened is we had made a changes in the decimal places for some quantity related extended datatype which resulted some vendor payments and related subledger transactions are not matching with some minor difference like 0.20, 0.30 etc. we have identified those transactions and we need to do this action to match them. We have successfully done the same in UAT environment using the JIT SQL access  and now we need to do the same in live environment to match or correct the transactions. For sure I cannot edit the value in bank account transaction table ? then is there any other way than reversing those transactions and redoing it again ?. Thanks. 
  • Anton Venter Profile Picture
    20,345 Super User 2025 Season 2 on at
    Hello,
     
    You should be able to update the transaction(s) without any issues using the SysClassRunner class instead of the custom script method. But that will require your class to be deployed to production environment though and that means down time of the production environment.
  • Suggested answer
    Lauras U Profile Picture
    955 on at
    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%
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans