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 :
Microsoft Dynamics AX (Archived)

Get list of record which are updated. c# code AIF

(0) ShareShare
ReportReport
Posted on by 902

Hello ,

I am using AIF service with c# code.

I want to get list of record which are updated. Is there any filter CriteriaElement who gives only updated record of particular table. I don't wont to use modified date & time. 

Currently I am using following code for insert purpose Ax-third party systems.

 criteriaElements = new CriteriaElement[2];
            criteriaElements[0] = new CriteriaElement();
            criteriaElements[0].DataSourceName = "CustTable";
            criteriaElements[0].FieldName = "AccountNum";
            criteriaElements[0].Operator = Operator.Range;
            criteriaElements[0].Value1 = "C-00005000";
            criteriaElements[0].Value2 = "C-00006000";

            criteriaElements[1] = new CriteriaElement();
            criteriaElements[1].DataSourceName = "CustTable";
            criteriaElements[1].FieldName = "ForecastDMPInclude";//this field needs to change - Ax developer will provide
            criteriaElements[1].Operator = Operator.Equal;
            criteriaElements[1].Value1 = AxdExtType_ForecastDMPInclude.No.ToString();
            //criteriaElements[1].Value2 = "C-00003370";
            queryCriteria = new QueryCriteria();
            queryCriteria.CriteriaElement = criteriaElements;
            #endregion

            axdCustomer = _Client.find(_callContext, queryCriteria);//get customer list

Now I want update this created record so only need updated record using single key field from ax table.

Please do needful.

Thanks,

keyur shah.


           

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Updated since when?

    Are you aware 'getChangedKeys' operation of AIF document services?

  • keyur7379 Profile Picture
    902 on at

    Thanks Martin.

    1. Updated since when?

    - I need options like updated today,yesterday,before 1 week.

    2. Are you aware 'getChangedKeys' operation of AIF document services?

    - No.

    Please give me a code sample to get updated record using 'getChangedKeys' AIF c#.

    Thanks,

    keyur shah.

  • keyur7379 Profile Picture
    902 on at

    Hello Martin,

    I have used getChangedKeys. I am getting error. Please check below screenshot.

    3683.Untitled.png

    I think I have to do some setting from ax database side. Please provide me process how to enable getChangedKeys .

    Thanks,

    keyur shah.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Maybe you forgot to configure change tracking.

  • keyur7379 Profile Picture
    902 on at

    Hi Martin,

    As you said,I have enabled change tracking. Also I have restart ax database service. Please find attached screenshot.

    8666.Untitled.png

    Bit I am getting same error while using

     DocumentPaging dp = new DocumentPaging();
                dp.PageSize = 100;

                var m = _Client.getChangedKeys(_callContext, dp, DateTime.Now.Date);

    Error : Change Tracking Is Customer_Integration.CustomerService.EntityKeyPageStatusDetails.ChangeTrackingDisabled

    Thanks,

    keyur shah.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Try AifChangeTrackingConfiguration::enableChangeTrackingForQuery() (with the query used for the document service). Unfortunately I don't remember how this is done through GUI; I would have to look to an AX 2012 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

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans