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, ...
Answered

updates view "ENTITY" which participates in a join and has an INSTEAD OF UPDATE trigger.

(5) ShareShare
ReportReport
Posted on by 1,967
Hi,

When importing the entity, i got this error:
UPDATE is not allowed because the statement 
updates view "ASSETFIXEDASSETV2ENTITY" which participates in a join and has an INSTEAD OF UPDATE 
trigger.
Object Server Azure:
Results	Cannot execute the required database operation.
The SQL database has issued an error.
I found that the solution is to go to data entities in the UI, look for the entity and change the 'set based operation' to false.

- but can someone explain to me what does this error mean and why it failed for this entity? and why would this flag be set to true by default what is it's benefit?



Now after, i set this value to false, when i tried to import the entity again to update the asset group Id, i got this:
update not allowed for field 'AssetFixedAssetV2Entity.FixedAssetGroupId
This field has allowEdit false on the table level.
on the entity, the field has AllowEdit as Auto, so i created an extension of the entity and made allowEdit as true
however, the allowEdit property of the field in the entity staging table is set to No and when i create an extension of the staging table it doesn't allow me to change this property.

- it seems changing the entity property is not enough, as the import is still failing, or would it have worked if the staging table property was Auto?

- is the only solution now to create a custom entity to be able to update the assetGroupId? 
Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    What are you importing and how? Are you just importing a file directly to AssetFixedAssetV2Entity through data management?
     
    Have you tried changing Set-based processing in data entity configuration, before making any code changes?
     
    The purpose of set-based processing is better performance.
     
    F&O doesn't allow changes of AssetTable.AssetGroupId. Try it through a form; you'll see that it indeed can't be changed. What is the busincess scenario where you need to change a group of an existing asset and how would you achieve that in F&O GUI?
  • .. Profile Picture
    1,967 on at
    Hi Martin,

    yes I'm importing an excel file throught DMF using AssetFixedAssetV2Entity  
     
    And yes I already said that i found the solution to fix the error in the question, by setting 'set-based processing' property to false, but my questions was, why i had to do this? what is in the entity that makes it not work when the property is true?





    regarding changing the group from the UI, you would do it from here, so shall i create a new entity?
  • Suggested answer
    Aymen CHELBI Profile Picture
    574 on at
    Hello,
     

    Solution:

    • Disabling "set-based operation": In D365FO, the set-based operation flag controls whether updates are performed in batches or not. If set to True, D365 tries to apply set-based operations, which are often not compatible with triggers (like INSTEAD OF UPDATE).
    • By setting this flag to False, D365FO falls back to row-by-row operations, which are more compatible with entities involving triggers like INSTEAD OF UPDATE.
    Best regards,
  • .. Profile Picture
    1,967 on at
    Hi Ayman,

    What do you mean by instead of update?


    I had two questions:

    - why for this entity exactly, set-based processing didn't work? i read that this might happen if the entity has views, but this one doesn't

    - is the only way to update fixed-asset group is to create a new custom entity?
     
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    The error suggests that there is a trigger in database. Checking what the trigger does will tell you what feature it's related to. Then maybe you can disable the feature to get rid of the trigger.
  • .. Profile Picture
    1,967 on at
    Hi Martin,

    i will check and let you know

    but what about the fixed asset group? i put a screenshot before to show you how we update it from the UI
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    You can see that the fixed asset group field is read-only; you can't simply change its value. This is true for both forms and data entities.
     
    You're suggesting that the only way is using AssetChangeGroup class. That's what you do from, but this class is not called from any data entity.
  • .. Profile Picture
    1,967 on at
    Hi Martin,

    i created a new entity but I still get "update not allowed for field 'XXAssetFixedAssetV2Entity.FixedAssetGroupId"

     

    here are the properties of the entity field 
     
     
     
    and here are the properties of the field in staging table
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    Let me just repeat what I suggested before:
     
    The error suggests that there is a trigger in database. Checking what the trigger does will tell you what feature it's related to. Then maybe you can disable the feature to get rid of the trigger.
  • Suggested answer
    Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at
    Your approach is wrong. As I said, you aren't allowed to change the value of the table field directly. You'd miss business logic related to the change and you could ruin consistency of your (your client's) database.
     
    You can use AssetChangeGroup class to do the change.

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans