Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Data entity shows different data for a virtual field; via DMF and Odata endpoint

Posted on by 3
Hello,

I have created a virtual field in a custom order line data entity. When i export the data entity via DMF, it shows correct data (integer value 1) for the virtual field, but when i hit its Odata endpoint, the value in the virtual field is incorrect (integer value 0).

The virtual field is basically the difference of total invoiced quantity and quantity returned for an order line. 

I assumed that the virtual field is not generating correct data for an integer value, so I hard-coded an integer value (integer value 20) as an experiment to my assumption. To my surprise, the hard-coded value is generated correct for both DMF and Odata.

Any thoughts will be highly appreciated.

EDIT: I have debugged the postLoad method of the data entity and it sets the correct/expected value in the virtual field. However, in its Odata call, the data is displayed incorrectly.
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,113 Super User 2024 Season 2 on at
    Data entity shows different data for a virtual field; via DMF and Odata endpoint
    Hi Community User, 

    When you retrieve information via OData and Data Management export, did you use all the fields? Did you also include the total invoiced quantity and quantity returned fields?
  • Layan Jwei Profile Picture
    Layan Jwei 7,316 Super User 2024 Season 2 on at
    Data entity shows different data for a virtual field; via DMF and Odata endpoint
    Hi Community User,

     So I'm assuming in your postLoad you have sth like this:
    Virtual= total invoiced quantity - returned quantity

    So when you debugged via DMF what was the value of the total invoiced quantity and returned quantity?

    Then when u called odata and debugged, what was their values?
    I mean which field is causing the wrong value based on your debugging.

    Also if you could share ur code with us please.
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Data entity shows different data for a virtual field; via DMF and Odata endpoint
    Thanks Martin for your suggestion.

    I have updated the description to inform that I have already debugged and in the postLoad method, correct/expected value is set. However, in the Odata call, the data is displayed incorrectly.
  • Martin Dráb Profile Picture
    Martin Dráb 229,918 Most Valuable Professional on at
    Data entity shows different data for a virtual field; via DMF and Odata endpoint
    Don't forget that F&O/VS comes with a debugfer, which you can (and should) use to collect  ore information about your problem.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans