Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Not able to get current date filter option in fetch xml

Posted on by 140

Hi All,

I am using D365 currently, i have a query regarding fetch xml, i need entity data if current date is in between start date and end date then display record.

i tired but not able find the way where i can get current date value.

Can any one help me on this.

Regards,

Jyotsna 

*This post is locked for comments

  • Suggested answer
    Iswarya Profile Picture
    Iswarya 1,345 on at
    RE: Not able to get current date filter option in fetch xml

    Hi,

    Create one field make this field is Hide, update this field value daily using Windows  application,Register Your  windows Application in Task Schedular  , then use this field in your report

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Not able to get current date filter option in fetch xml

    Hi,

    Did you check the above workaround of using Today? "how to pass date dynamically in fetch XML" depends upon where are you using the fetch, for example, If it is C# code then you could get the current datetime and then add it to the fetchxml

  • RE: Not able to get current date filter option in fetch xml

    Hi Ravi ,

    Thanks for the suggestion , can you please suggest how to pass date dynamically in fetch XML.

    Thanks & Regards,

    Jyotsna

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Not able to get current date filter option in fetch xml

    Hi,

    There is one workaround to achieve this with fetch xml as as well. Refer below screenshot-

    datecheck.png

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Not able to get current date filter option in fetch xml

    Hi,

    The only filter related to current date is today which can only be used like <>particular date field> is on "Today". You cannot use today in any other condition.

    However if you are using this fetch xml in custom code then you can dynamically pass the current date to apply your desired filter.

    Hope this helps.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans