web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Method (GreaterThanUtcNow()) failing build & sync

(1) ShareShare
ReportReport
Posted on by 209
Hello Cmmunity Experts,
 
I have one custom data entity which has many data sources and the parent in HcmPosition. Among first joins is HcmPositionDetails which has an outer join relation with HcmPosition.

 
 
I have added one range on the ValidTo field of HcmPositionDetails but its throwing build error afterwards.
 
"A local variable named '_isAnyFieldSet_' cannot be declared in this scope because it would give a different meaning to '_isAnyFieldSet_', which is already used in a parent or current scope to denote something else."
 



Not sure why this is the case as in the following documentation from Microsoft the method is mentioned to use for date range queries.
https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/advanced-filtering-query-options#advanced-date-queries-that-use-sysqueryrangeutil-methods
 
Looking forward to helpful responses :)
 
Best Regards.
I have the same question (0)
  • Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Hi alinawaz,
     
    Are you sure the error started appearing after u added the range?  so if you remove this range, would the error go?
  • alinawaz Profile Picture
    209 on at
    Yes that Error started appearing only after I added the range on HcmPositionDetail Datasource.
    Plus, when I add the same range on the Data entity's range node, there is no build or sync error but the range isn't working either. Checked the data in SQL.
  • Suggested answer
    Komi Siabi Profile Picture
    13,218 Most Valuable Professional on at
  • Suggested answer
    Martin Dráb Profile Picture
    239,634 Most Valuable Professional on at
    What you're trying to do is logically wrong, therefore if you get rid of the error, it still won't to do what you want.
     
    A data entity is a SQL view in the database. The view can't connect to F&O and execute X++ code, including greaterThanUtcNow() function. It simply can't work. The only thing you could get is getting greaterThanUtcNow() executed on DB sync, therefore the time of the DB sync would be hard-coded in the entity definition. It wouldn't use the current date time when querying the data.
     
    Date-effective data entities require a different approach. Please refer to F&O documentation (Date effectivity) for details.
  • Verified answer
    alinawaz Profile Picture
    209 on at
    Changing the join type to Inner Join from Outer join has resolved the problem.
    Build and Sync is successful, plus the range is also applied.
     
    Thanks guys :)
    Cheers
  • Martin Dráb Profile Picture
    239,634 Most Valuable Professional on at
    The range is applied, but is the range value correct? I still expect a hard-coded value, which isn't what you wanted. Please look at the actual view in SSMS to see what you've generated. That the view gave you the correct result at that moment doesn't mean that it'll be correct tomorrow.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 802

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 636 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 534

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans