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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Change generalLedgerSetup allowPostingFrom and To with API?

(2) ShareShare
ReportReport
Posted on by 8
I want to change properties of the genaralledger setup (really just the posting from and to dates) via an API).
I have successfully done many things with the API, such as writing Journal data and GETting all manner of data.
Using Postman, I have tried all combinations of: generalLedgerSetup API, ODATA and Page 118 exposed as Allow Write, setting if-match (tried various etag formats),  setup ID in the URL, etag ID in if-match, asterisk in if-match, no if-match at all etc etc. I believe the simple body JSON is fine - and is: { "allowPostingFrom": "2026-01-01", "allowPostingTo": "2026-01-02" }
But, the best responses I ever get are only:
 
"Entity does not support modifying data"
"'PATCH' requests for 'generalLedgerSetup' of EdmType 'Collection' are not allowed within Dynamics 365 Business Central OData web services"
 
Can anyone say, definitively, if it is possible to do this with out-of-the-box config without creating AL code, extending the API etc. - and, please, if so, how?
I have the same question (0)
  • Verified answer
    Grigorios Mavrogeorgis Profile Picture
    2,514 Super User 2026 Season 1 on at
    Hi,

    Short answer is no, this cannot be done out of the box.

    The standard  general ledger Setup  API in BC is read-only by design. The error "Entity does not support modifying data" is exactly that, Microsoft has not exposed PATCH on the General Ledger Setup. It is a singleton setup table and the standard API page does not allow write, even if Page 118 is exposed as a web service with Allow Write turned on, OData still treats it as a collection and blocks PATCH.

    So the two options are:

    Either expose Page 118 through a custom API page in AL, with the right entity name and a key, and PATCH against that.  To enable the PATCH method, the custom API page must use SystemId as the ODataKeyFields. This gives the OData endpoint the unique identifier it needs to update the record.

    Or use an Automation Flow / a simple codeunit exposed as a bound action, but that also needs AL.

    There is no Postman-only, configuration-only way to update General Ledger Setup. The "Allow Write" trick on the SOAP/OData page service does not bypass the singleton restriction on this particular page.

     
    ✅ Tick the checkbox below to mark the answer as verified, if it helped resolve your question.
     
    Regards
    Gregory Mavrogeorgis
     
  • JS-07051148-0 Profile Picture
    8 on at
    Thank you for such a helpful and informative reply. This is what I feared, but it is quite understandable. The AL coding is being outsourced in our case, so I guess we will need to get the contractor involved. Other info on the web gives a different impression, but is possibly wrong or outdated. 
    Many thanks again. Much appreciated.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,222 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,603 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,186 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans