Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Enabling Data Posting by Modifying ReadOnly Entity

(1) ShareShare
ReportReport
Posted on by 11

Hello Microsoft Dynamics Community,
I am currently working with Dynamics 365 Finance and Operations and facing a challenge related to data posting via the OData API. I am attempting to post data to the `SalesInvoiceJournalHeaderEntity`, but my efforts are hindered by the entity's ReadOnly status, as indicated by the error:
 

```
Write failed for table row of type 'SalesInvoiceJournalHeaderEntity'. Infolog: Error: insert/update/delete not allowed for entity with ReadOnly = Yes.
```
 
This issue has stopped me from automating the creation of Sales Order Invoices, which is critical for streamlining our business processes. Here are the details of my approach and the obstacle I am encountering:
1. Objective: Automate the creation of Sales Order Invoices through data posting using the OData API.
2. Issue: The entity `SalesInvoiceJournalHeaderEntity` I need to post to is marked as ReadOnly, preventing any create, update, or delete operations.
3. Question:
   - Is there a way to modify the ReadOnly status of an entity within Dynamics 365 F&O without extensive customization?
   - Can this change be achieved through configuration or minor adjustments, or does it require a full customization project?
I seek guidance on whether it is possible to adjust the ReadOnly property of this specific entity to allow data posting, and if so, how this can be done ideally with minimal custom development. Any insights, including experiences with similar issues or recommended practices, would be highly appreciated.
Thank you for your assistance!
  • FB-08050748-0 Profile Picture
    11 on at
    Enabling Data Posting by Modifying ReadOnly Entity
    Thank you for your prompt response! This was what I was looking for.
  • Verified answer
    Martin Dráb Profile Picture
    231,831 Most Valuable Professional on at
    Enabling Data Posting by Modifying ReadOnly Entity
    Yes, you can post a sales order - that was actually my own suggestion. But you originally asked for a completely different thing - inserting data through SalesInvoiceJournalHeaderEntity, which would completely skip invoice posting.
     
    One option is utilizing FormletterService.postSalesOrderInvoice() as a custom service. But it may be beneficial to create a custom solution with a simpler interface. For example, on my current project, we use a custom data entity with an OData action calling SalesFormLetter_Invoice.update(). It gets just SalesId and DataAreaId as the parameter and invoice the whole order. The posting framework have many more options, but this is sufficient for our scenario.
  • FB-08050748-0 Profile Picture
    11 on at
    Enabling Data Posting by Modifying ReadOnly Entity
    Thank you @Martin Drab for your response. I think I was not clear on my requirement and objective, what I do is integrate the data from ecommerce to F&O. In this process we have to sync the invoice data coming from ecommerce to F&O as well. For this reason, I wanted to get the invoice post operation done. I have previously worked with BC and it does provide an API endpoint to post sales invoice, so based on that assumption, I thought F&O might have something similar to it.
  • Martin Dráb Profile Picture
    231,831 Most Valuable Professional on at
    Enabling Data Posting by Modifying ReadOnly Entity
    The whole idea is wrong. Creating a record in that table wouldn't produce the right result, because invoice posting includes many other steps. Most importantly, it infuelences accounting entries. You'd have an invoicejournal but the sales order wouldn't actually be invoiced, therefore the state of your database wouldn't make sense.
     
    Instead of trying to import data directly to invoice journals, run invoice posting and let F&O do all the necessary steps.

    (Moved from D365 general forum.)

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,997 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,831 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans