Skip to main content

Notifications

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

Error inserting data in entity by code

(0) ShareShare
ReportReport
Posted on by 190

Hello everybody, 

I am facing an issue during inserting data by code in a custom entity. 

When I try to insert data by using entity.insert(), everything goes ok. Meanwhile, when I try to optimize and use recordinsertlist class, it gives me the following error:

Cannot create a record in Import MyEntity(MyEntity).
Microsoft Dynamics 365 for Finance and Operations views are read-only.

Can anyone help, please?

Thanks in advance!

  • Elda Mataj Profile Picture
    Elda Mataj 190 on at
    RE: Error inserting data in entity by code

    Both entities have the property "Enable Set Based SQL Operations" set to Yes.

  • Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: Error inserting data in entity by code

    Isn't the difference between those entities in "Enable Set Based SQL Operations" property?

  • Elda Mataj Profile Picture
    Elda Mataj 190 on at
    RE: Error inserting data in entity by code

    Thank you for your reply.

    I am using RecordInsertList only for a better performance. It already works with a simple insert.  

    Also with another custom entity, the recordInsertList works correctly.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: Error inserting data in entity by code

    I would be surprised if such a thing was supported, and the error seems to confirm that it isn't.

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans