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... 290,524 Super User 2024 Season 2 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.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans