Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / About enable change tr...
Finance forum
Answered

About enable change tracking through enable custom query change tracking.

Posted on by 155

Hi every one I am new to AX. I am doing some Research and development on change tracking .

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/data-entities/entity-change-track

In the above link I am not understanding what is written in custom query for change tracking. I would be very great full if some one explains me in a step by step procedure of what they have  done.

2019_2D00_05_2D00_24_5F00_1722.png

I am very confused with the highlighted statements.

  • Neetha Profile Picture
    Neetha 155 on at
    RE: About enable change tracking through enable custom query change tracking.

    Thank you so much wang

  • Verified answer
    Blue Wang Profile Picture
    Blue Wang on at
    RE: About enable change tracking through enable custom query change tracking.

    Hi Neetha,

    There are three ways to enable change tracking (that is, those you find in the screenshot),.

    Enable primary table, it only changes the entity by updating the primary table.

    0876.2.PNG
    You need to choose the right one for your needs.

  • Neetha Profile Picture
    Neetha 155 on at
    RE: About enable change tracking through enable custom query change tracking.

    how to enable change tracking on Table not part of the entity.  Data Management - > Data Entities - > (Filter Select Your Entities) - > Change Tracking - > Enable Primary table. Is this the correct path?

  • Verified answer
    Blue Wang Profile Picture
    Blue Wang on at
    RE: About enable change tracking through enable custom query change tracking.

    Hi Neetha,

    First, the requirement is to enable change tracking on the table, not part of the entity. A join query table is needed to populate the values in the entity.
    The part you point out is custom query change tracking, which means changing data in a custom table will change the data in the entity accordingly.
    The meaning of the code is to create a query and return the query object based on the relationship between the entity's root table and the custom table.

    Query q;
    
    q = new Query();
    QueryBuildDataSource qbd = q.addDataSource(tablename2id('ATable'));
    qbd = qbd.addDataSource(tablename2id('BTable'));
    qbd.relations(false);
    qbd.addLink(fieldName2Id(tableName2Id('ATable'),'C'),fieldName2Id(tableName2Id('BTable'),'C'));
    
    return q;


    You can go to Data Management - > Data Entities - > (Filter Select Your Entities) - > Change Tracking - > Enable Custom Query

    4011.1.PNG

  • Neetha Profile Picture
    Neetha 155 on at
    RE: About enable change tracking through enable custom query change tracking.

    I am not clear about second part in the above link they used the standard customer entity. how to create a join between an entity and the method which returns query.

  • Suggested answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,637 Moderator on at
    RE: About enable change tracking through enable custom query change tracking.

    First part says you have to enable change tracking on the tables that you are using in query and second part is to join your entity with root data source of the query,you must have created for change tracking.

    Following options from entity page on data management workaspcae enables change tracking for all entity datasources.

    Enable entire entity – It will enable tracking for all Writable Datasource used in the entities.

    Second part is very clear about join . Hope this helps . If not please mention what you are not getting.

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,436 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,206 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans