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

Static method in static query range

(2) ShareShare
ReportReport
Posted on by 525
I try to use a static method of a table that returns a str of SalesId number..
 
 
 
but I get this error: 
 
I debugged my code and the method returns the correct value!
  • Verified answer
    Martin Dráb Profile Picture
    240,785 Most Valuable Professional on at
    The problem is that it must be a class, not a table. Also, don't forget to decorate the method with QueryRangeFunctionAttribute, if you haven't already done it.
  • AbdullahAhmed_ Profile Picture
    525 on at
    Yes it worked, thank you...
     
    Actually this query is used in xds policy... can I add the range in init method of the query instead?
  • Martin Dráb Profile Picture
    240,785 Most Valuable Professional on at
    Good to hear that the problem has been resolved. Please don't forget to verify the answer.
     
    XDS is off-topic here, but in short, I don't think you can run code in init() of a query object used in XDS. I see you have a thread (Set Dynamic ranges for XDS policy) where you're confirming that it indeed doesn't work.
  • AbdullahAhmed_ Profile Picture
    525 on at
    I don't know why when I mark a response as an answer it just keeps loading and nothing happens..
     
    Yes, I posted that thread but I don't know how to adjust the xds policy query in code! Is it even possible?
  • Martin Dráb Profile Picture
    240,785 Most Valuable Professional on at
    Unfortunately, your problem with verifying the answer is caused by a bug of this site. I wish it was fixed ASAP, but we're waiting for it since the introduction of the new platform. I've done it for you; doing in in someone else's threads usually work for me (I can do it because I'm a moderator).
     
    Regarding XDS, I already gave you my opinion that it's not possible.
     
  • AbdullahAhmed_ Profile Picture
    525 on at
    Thank you..
     
    The other topic that was referred to: Set Dynamic ranges for XDS policy
  • Martin Dráb Profile Picture
    240,785 Most Valuable Professional on at
    Please stop. The other topic doesn't belong here; this thread is about "Static method in static query range" and it's already answered. Also, you already have a thread for the other topic and duplicating the discussion here would just cause confusion and duplicated effort.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 430 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 368

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 364 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans