Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Querying AX Data

Posted on by 1,272

Hi,

How can I query data based on the last modified date time field. i am using AIF services to retrieve data but it isn't allowing me to query on the last modified date.

It says that the PurchTable does not have a field named modifiedDateTime.

Thanks

  • Dick Wenning Profile Picture
    Dick Wenning 8,705 on at
    RE: Querying AX Data

    System.DateTime netDttm;

       utcdatetime xppDttm;

       str xppString;

       ;

       xppDttm = 2007-06-05T23:22:21; // ISO standard format.

       // Convert X++ to .NET.

       netDttm = Global::utcDateTime2SystemDateTime(xppDttm);

       // Convert .NET to X++.

       xppDttm = Global::CLRSystemDateTime2UtcDateTime(netDttm);

       xppString = DateTimeUtil::toStr(xppDttm);

       info("xppDttm: " + xppString);

  • dynamics developer Profile Picture
    dynamics developer 1,272 on at
    RE: Querying AX Data

    Thanks Dick Wenning for your reply. But i am writing code in C# and using AIF to query data from AX.

  • Dick Wenning Profile Picture
    Dick Wenning 8,705 on at
    RE: Querying AX Data

    from code:

       utcdatetime utc3 = str2datetime( "1985/02/25 23:04:59" ,2131 );

       str Temp = datetime2str( utc3 );

    ore use SysQueryRangeUtil class in the range of the query, do you know how to use?

  • dynamics developer Profile Picture
    dynamics developer 1,272 on at
    RE: Querying AX Data

    Hi

    now it keeps giving the error

    "The UTC date/time string is not in the expected format"

    Can you tell me what is the correct format for querying?

  • dynamics developer Profile Picture
    dynamics developer 1,272 on at
    RE: Querying AX Data

    Thanks Andre

    I really need this field because i am integrating POs with another application based on last modified.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,584 Super User on at
    RE: Querying AX Data

    Hi,

    Check the table property 'ModifiedDateTime'. This might be standard not enabled (No). Then this field is not availabe. If you set the parameter to Yes, the field is enabled. All already existing records will not have this field filled. Future records will have it. Please note that updating this field will cost some time and can in some cases badly influence your performance.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans