Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Data entity Ranges node does nothing in D365

Posted on by 501

Hi;

Testing the Range functionality provided on Data Entities in D365

Scenario: I'm trying to apply a date range to my custom data entity in order to export only the records that were modified yesterday. This will be a recurring export job to daily export only modified records.

Problem: There is a Ranges property that is on Entity level where you can apply ranges to fields in your data entity but seems like it is not working as even a numeric field value range added on it does not filter the results. I am aware of filters available on a functional level as well as ranges available on the datasource level but I want to test out the Ranges on the data entity itself. I also do not see the range applied on SQL level when I see the script of the view for the entity; however they are visible ranges applied on a datasource level.

Question: What is this Ranges node for if not for applying a range to the resultant data set?

7752.range.png

*This post is locked for comments

  • TomJ77 Profile Picture
    TomJ77 on at
    RE: Data entity Ranges node does nothing in D365

    I found that I had this problem whilst setting a range from a table with an outer join - I switched it to InnerJoin and the range worked as expected.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Data entity Ranges node does nothing in D365

    Hi,

    Do you know if it is possible to use some functions in Value on Datasource range like tableNum? I need to filter records using refTableId, so I want to have for example tableNum(CustTable) but that does not work. It works only if I specify exact numeric value of CustTable tableId.

  • Mantas Sliogeris Profile Picture
    Mantas Sliogeris 20 on at
    RE: Data entity Ranges node does nothing in D365

    Hi, thanks for detailed conversation guys.

    I have a similar problem as Mohsin - I can't get data entity ranges to work when adding a range on base enum field.

    It works if I add it on datasource range, but it doesn't work if I add it on data entity range.

    I've looked into Martin's example LedgerAccountStructureActiveOnlyEntity and I think it is not a good example, because not only it has range on data entity (which probably doesn't work), but it also have the same range on data source (which is actually working).
    bankJournalLineEntitySql.png

    LedgerAccountStructureActiveOnlyEntitySQL.png

    Lets take another example - BankJournalLineEntity. It has ranges only on data entity, no ranges on data source and if you go and check view creation script on SQL you can actually see that there are no filter applied for this data entity view.

    bankJournalLineEntity.png

    bankJournalLineEntitySql.png

    We have the same situation with HcmSharedParametersEntity and some other.

    It looks to me that data entity ranges don't work..

    Please share your findings on this topic.

    Regards,

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Data entity Ranges node does nothing in D365

    Enable change tracking for the customer entity in D365 UI (Data entities form), and set incremental push for your data project. You will always get all new and changed customers. Does this meet your business requirement?

  • Muhammad Yasir Profile Picture
    Muhammad Yasir 1,023 on at
    RE: Data entity Ranges node does nothing in D365

    Hi Mohsin,

    Did u find any way to do that. i exactly have same requirement of adding the range to  modifiedDateTime field of CustTable. If you know. then please share the way how u did that.

    Thanks,

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Data entity Ranges node does nothing in D365

    Aha, so you want to use data management but you don't know how to add a filter. Create an export project and add an entity. Then find the Filter column and click the funnel icon:

    DMFilter.png

    It will open the usual "advanced filter" form, where you can add you filter.

    This is dynamic; what you tried wouldn't be.

    I have no idea what you're talking about regarding "change tracking would require a user to read from the table"; it doesn't sound like anything about change tracking. I'm talking about increment exports in data management. Let me quote AX documentation:

    Change tracking is a feature that enables incremental export of data from Microsoft Dynamics 365 for Finance and Operations, by using Data management. In an incremental export, only records that have changed are exported. To enable incremental export, you must enable change tracking on entities. If you don't enable change tracking on an entity, you can enable only full export each time.

  • Mohsin Khalid Profile Picture
    Mohsin Khalid 501 on at
    RE: Data entity Ranges node does nothing in D365

    "What you need is including the field which you want to filter (ModifiedDateTime) in the view. Then apply the range when querying the entity, e.g. in an export project or an OData query."

    I meant it wont be a dynamic range/filter that filters each record by today's date whenever its run cause as far as I checked there is no option to apply a dynamic range on export project level filters. IF that is what you meant, like so:

    rangedate.png

    "I assume you want to use ModifiedDateTime to identify changed records. That's exactly what change tracking is for."

    Yes, however change tracking would require a user to read from the table, it would not push a file to a designated folder of the changed records(which is what im looking to do); correct?

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Data entity Ranges node does nothing in D365

    Can you please elaborate what you mean by "that would be out of the scope of a recurring data entity job"?

    I assume you want to use ModifiedDateTime to identify changed records. That's exactly what change tracking is for.

  • Mohsin Khalid Profile Picture
    Mohsin Khalid 501 on at
    RE: Data entity Ranges node does nothing in D365

    Thank you for checking, I'll try to create a new one and see if it happens there as well.

    I see, but that would be out of the scope of a recurring data entity job. Isnt there any method inside the data entity to modify the query or datasources? There is a mapDataSourceToEntity() method but that is to transform the result, i wonder if i could somehow use it to filter the record as well.

    I haven't checked change tracking so will do but it seems more of a get then a push on change utility.

  • Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Data entity Ranges node does nothing in D365

    I'm sorry, but I don't have enough information to identify what you're doing wrong with the numeric field. It works all right in my environment.

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans