Skip to main content

Notifications

Announcements

No record found.

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

Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

(0) ShareShare
ReportReport
Posted on by 11,304

I have created a custom entity in D365 F&O, I am able to successfully export the entity data, but upon import i get the following error

Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

I cannot seem to find anyone experiencing the same issue, debugging to the point of when the update is called on the entity is very similar to another custom entity that works. Both have a record at the time of calling update in DMFEntityBase.insertUpdate() _target.update();

Could anyone guide me as to what i may be doing wrong?

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    You're definetely not the first or the last to spend hours with something that turns out to be a simple mistake :)

    Thanks for sharing the explanation for your problem! This way we can learn also from each other's mistakes.

  • Suggested answer
    Jonathan  Halland Profile Picture
    Jonathan Halland 11,304 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    Hi Nikolaos.

    I'm embarassed to admit on the forum, but after scouring code i found that i mistakenly missing the super call in my postLoad method. After removing and debugging for hours that is what it came down to.

    Anyway, incuding the fix for anyone else ends up doing the same silly thing and can't figure out what went wrong!

    Thanks for your help.

  • Jonathan  Halland Profile Picture
    Jonathan Halland 11,304 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    Hi Nikolaos.

    Thanks for your assistance, but I've reviewed all the code, there is nothing referring to the old entity, i did have it working at one point, somewhere along the line it stopped working. I'm busy stripping everything out that I have done to see what could be the step that broke it, but The error seems very strange / unrelated to anything i've done

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    You can try to remove this data source and see if it has an impact.

    But perhaps the issue is in the x++ code of this entity. Quite often I see people having issues after copying standard entities, and they were caused by still having parts of the entity x++ code using the standard entity or standard staging table instead of your new entity / staging table.

  • Jonathan  Halland Profile Picture
    Jonathan Halland 11,304 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    It was create as a copy from an existing standard entity with an additional Datasource added on an outer join. The additional datasource was added to a similar entity as well in the same fashion and it works there, so i dont think that that is the problem.

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    And how did you create this entity?

  • Jonathan  Halland Profile Picture
    Jonathan Halland 11,304 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    Hi Nokolaos

    Thank you for moving the post. The entity key does correspond to a unique index. At the debug point mentioned the "_target" buffer even has a recId and is populated as is the case with a working entity.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Custom Entity - Results. Cannot edit a record in [Entity label] ([EntityAOTName]). The record has never been selected.

    Moved to D365 Finance forum.

    Most likely you have some issue with your entity key. Did you create this entity with the entity wizard?

    Please check that your entity key fields correspond to an unique index in your table.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,462 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,551 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans